![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计算机视觉
joker-G
这个作者很懒,什么都没留下…
展开
-
tensorrt dockerfile
cuda10 # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at##原创 2022-04-01 17:48:09 · 722 阅读 · 0 评论 -
tensorRT 与 torchserve-GPU性能对比
实验对比前端时间搭建了TensorRT 、 Torchserve-GPU,最近抽时间将这两种方案做一个简单的实验对比。实验数据Cuda11.0、RTX3090 24G、Resnet50TensorRT 、Torchserve-GPU各自一张卡搭建10进程接口,感兴趣的可以查看我个人其他文章。30进程并发 、2000 1200*720总量数据TensorRT 的部署使用了RTX3090 10进程Torchserve-GPU的部署使用了RTX3090 10进程Torchserve-CPU的部署原创 2021-09-15 16:33:02 · 1574 阅读 · 4 评论 -
图像叠加合成
PILfrom PIL import Imagedef img_trans(): img98 = './banner/IPADbanner1080×380/98.png' img99 = './banner/IPADbanner1080×380/99.png' img98 = Image.open(img98) img99 = Image.open(img99) target = Image.new('RGB', (2393, 727), (255,原创 2021-07-21 16:10:10 · 537 阅读 · 0 评论 -
labelImg xml >> yolotxt
import xml.etree.ElementTree as ETimport os, globclasses = ['1', '2', '3', '7']def convert(size, box): dw = 1. / size[0] dh = 1. / size[1] x = (box[0] + box[1]) / 2.0 y = (box[2] + box[3]) / 2.0 w = box[1] - box[0] h = box[3]原创 2021-07-04 00:43:07 · 71 阅读 · 0 评论 -
图像相似度对比
import cv2from PIL import Imagefrom numpy import average, dot, linalgfrom skimage.metrics import peak_signal_noise_ratio as psnrfrom skimage.metrics import structural_similarity as ssimdef calc_similar(image1, image2): def hist_similar(lh, rh):.原创 2021-05-19 11:23:46 · 263 阅读 · 0 评论 -
tensorflow各种模型文件的生成
一,pb文件import osimport tensorflow as tffrom tensorflow.python.framework import graph_utildef freeze_graph(ckpt, output_graph): # 指定输出的节点名称,该节点名称必须是原模型中存在的节点 output_node_names = "predictions" saver = tf.train.import_meta_graph(ckpt.model_c原创 2021-04-02 11:47:40 · 677 阅读 · 0 评论 -
tensorflow-serving部署
一.镜像拉取测试docker pull tensorflow/servinggit clone https://github.com/tensorflow/servingTESTDATA="$(pwd)/serving/tensorflow_serving/servables/tensorflow/testdata"docker run -t --rm -p 8501:8501 \ -v "$TESTDATA/saved_model_half_plus_two_cpu:/mo原创 2021-04-02 11:36:29 · 243 阅读 · 0 评论 -
cv2监听鼠标事件画图
import cv2import numpy as npdef draw_circle(event, x, y, flags, p): global ix, iy, f if event == cv2.EVENT_MOUSEMOVE and flags == cv2.EVENT_FLAG_LBUTTON: f.write('{}\t{}\n'.format(x,y)) cv2.circle(img, (x, y), 3, (0, 0, 0), -1).原创 2021-03-09 15:06:17 · 503 阅读 · 1 评论 -
base64 > PIL/CV2编解码
base64 <> PILimport base64import cv2import numpy as npfrom io import BytesIOfrom PIL import Imageimg = Image.open('./nsfw/1.jpg')output_buffer = BytesIO()img.save(output_buffer, format='JPEG')byte_data = output_buffer.getvalue()modelImg原创 2021-03-04 11:02:02 · 314 阅读 · 1 评论 -
PIL.Image、cv2、skimage 的区别
import cv2from PIL import Imageimport matplotlib.pyplot as pltimport numpy as npimport skimage.iodef PILImageToCV(imagePath): # PIL Image转换成OpenCV格式 img = Image.open(imagePath) plt.imshow(img) img = cv2.cvtColor(np.asarray(img), cv2..原创 2021-01-16 14:09:05 · 352 阅读 · 0 评论 -
mAP计算方式
mAP计算方式Accuracy:准确率准确率=预测正确的样本数/所有样本数,即预测正确的样本比例(包括预测正确的正样本和预测正确的负样本,不过在目标检测领域,没有预测正确的负样本这一说法,所以目标检测里面没有用Accuracy的)。Precision:查准率Precision表示某一类样本预测有多准。Precision针对的是某一类样本,如果没有说明类别,那么Precisi...原创 2019-10-25 16:45:44 · 1969 阅读 · 0 评论 -
python实现nms
import numpy as npimport operatordef iou(box1, box2): x1, y1, w1, h1, s1 = box1 x2, y2, w2, h2, s2 = box2 x3 = max(x1, x2) y3 = max(y1, y2) x4 = min(x1+w1, x2+w2) y4 = min(y...原创 2019-10-13 21:50:45 · 194 阅读 · 0 评论