SSD目标检测
来源:互联网 发布:甲骨文软件开发 编辑:程序博客网 时间:2024/05/22 01:43
SSD目标检测
SSD是继yolo又一神作,对其理论这边就不介绍了,给上链接:
http://blog.csdn.net/u011534057/article/details/52733686
这边只讲代码编译,最近想试一下SSD的速度,看看在CPU端每秒能够检测几张图。原本一直编译C++(CAFFE)版本的,但是C++小白遇到很多问题,在同事的帮助下还是未能解决。后就选择编译TF的SSD,https://github.com/balancap/SSD-Tensorflow
按照网上的教程,测试很简单,这边只是对其作了简单的修改,直观的了解速度:
用jupyter notebook 打开SSD-Tensorflow/notebooks/ssd_notebook.ipynb
将:
gpu_options = tf.GPUOptions(allow_growth=True)config = tf.ConfigProto(log_device_placement=False, gpu_options=gpu_options)isess = tf.InteractiveSession(config=config)
注释掉,修改成
isess = tf.InteractiveSession()
(这里测试只用CPU)
最后显示部分也进行了修改,不适用原有的显示方式,而是调用摄像头,代码如下:
def Imshow_img(img, classes, scores, bboxes): height = img.shape[0] width = img.shape[1] for i in range(len(classes)): cls_id = int(classes[i]) if cls_id >= 0: score = scores[i] ymin = int(bboxes[i, 0] * height) xmin = int(bboxes[i, 1] * width) ymax = int(bboxes[i, 2] * height) xmax = int(bboxes[i, 3] * width) cv2.rectangle(img,(xmin, ymin), (xmax, ymax), (55,255,155),5) text = [str(rclasses[i]) +'|'+ str(rscores[i])] cv2.putText(img, text[0], (xmin, ymin-2), cv2.FONT_HERSHEY_TRIPLEX, 1, (255, 0 ,0), thickness = 1, lineType = 1)
import cv2 import numpycap = cv2.VideoCapture(0)while(1): # get a frame ret, frame = cap.read() rclasses, rscores, rbboxes = process_image(frame) Imshow_img(frame, rclasses, rscores, rbboxes) # show a frame cv2.imshow("capture", frame) if cv2.waitKey(1) & 0xFF == ord('q'): breakcap.release()cv2.destroyAllWindows()
如果想显示时间,也可以加上测试时间显示。
SSD的目标检测时间目前还是无法在嵌入式端使用,Google最近发布的tensorflow object detection API,将SSD和MobileNet结合,效果应该比SSD+VGG的好,后面会测试一下。
阅读全文
0 0
- SSD目标检测
- SSD目标检测
- ssd目标检测整理
- SSD目标检测原理
- SSD目标检测理解
- SSD模型--目标检测
- [配置SSD进行目标检测]
- 目标检测实例-SSD/examples/detection.ipynb
- 目标检测--SSD: Single Shot MultiBox Detector
- 使用keras实现目标检测之SSD
- CNN目标检测(三):SSD详解
- SSD目标检测框架教程--2017.3
- 目标检测 | SSD原理以及相关问题
- 理解SSD多盒-实时目标检测
- [目标检测]SSD: Single Shot MultiBox Detector
- Linux 编译SSD Caffe目标检测代码
- 基于深度学习的目标检测DET - SSD
- 以resnet作为前置网络的ssd目标提取检测
- Uncode系列开源组件简介
- Prime permutations Problem 49
- eclipse.ini
- U-net神经网络
- 【JavaScript】方法代码片
- SSD目标检测
- 深入理解 Spring 事务原理
- NSURLConnection 异步请求
- MySQL存储引擎之Spider内核深度解析
- 氰化物工作室的游戏Cthulhu,或最终获得VR支持
- Google MapReduce/GFS/BigTable三大技术的论文中译版
- 剑指offer——数据流中的中位数(好)(PriorityQueue,Comparator)
- Edit Latex in Ubuntu 16.04
- 链接