当前位置: 首页 > news >正文

网站建设代理网站济南又出现5例

网站建设代理网站,济南又出现5例,电子商务网站建设需要学什么,网页开发工具转载自非极大抑制#xff08;Non-Maximum Suppression#xff09;。 参考文章#xff1a; 1. Non-Maximum Suppression for Object Detection in Python 2. NMS非极大值抑制 最近在做人脸识别的项目#xff0c;其中在人脸检测算法中MTCNN算法是用到了NMS算法来筛选候选…转载自非极大抑制Non-Maximum Suppression。 参考文章 1. Non-Maximum Suppression for Object Detection in Python 2. NMS非极大值抑制 最近在做人脸识别的项目其中在人脸检测算法中MTCNN算法是用到了NMS算法来筛选候选的人脸区域得到最佳的人脸位置。 这个算法其实应用非常广泛在比较流行的检测算法中都有使用包括RCNN、SPP-Net中因为它主要作用就是在一堆候选区域找到最好最佳的区域。 大概原理如下 假设从一个图像中得到了2000region proposals通过在RCNN和SPP-net之后我们会得到2000*4096的一个特征矩阵然后通过N的SVM来判断每一个region属于N的类的scores。其中SVM的权重矩阵大小为4096*N最后得到2000*N的一个score矩阵其中N为类别的数量。 Non-Maximum Suppression就是需要根据score矩阵和region的坐标信息从中找到置信度比较高的bounding box。首先NMS计算出每一个bounding box的面积然后根据score进行排序把score最大的bounding box作为队列中。接下来计算其余bounding box与当前最大score与box的IoU去除IoU大于设定的阈值的bounding box。然后重复上面的过程直至候选bounding box为空。最终检测了bounding box的过程中有两个阈值一个就是IoU另一个是在过程之后从候选的bounding box中剔除score小于阈值的bounding box。需要注意的是Non-Maximum Suppression一次处理一个类别如果有N个类别Non-Maximum Suppression就需要执行N次。 python实现代码如下参考自Non-Maximum Suppression for Object Detection in Python # import the necessary packages import numpy as np import cv2# Felzenszwalb et al. def non_max_suppression_slow(boxes, overlapThresh):# if there are no boxes, return an empty listif len(boxes) 0:return []# initialize the list of picked indexespick []# grab the coordinates of the bounding boxesx1 boxes[:,0]y1 boxes[:,1]x2 boxes[:,2]y2 boxes[:,3]# compute the area of the bounding boxes and sort the bounding# boxes by the bottom-right y-coordinate of the bounding boxarea (x2 - x1 1) * (y2 - y1 1)idxs np.argsort(y2)# keep looping while some indexes still remain in the indexes# listwhile len(idxs) 0:# grab the last index in the indexes list, add the index# value to the list of picked indexes, then initialize# the suppression list (i.e. indexes that will be deleted)# using the last indexlast len(idxs) - 1i idxs[last]pick.append(i)suppress [last]# loop over all indexes in the indexes listfor pos in xrange(0, last):# grab the current indexj idxs[pos]# find the largest (x, y) coordinates for the start of# the bounding box and the smallest (x, y) coordinates# for the end of the bounding boxxx1 max(x1[i], x1[j])yy1 max(y1[i], y1[j])xx2 min(x2[i], x2[j])yy2 min(y2[i], y2[j])# compute the width and height of the bounding boxw max(0, xx2 - xx1 1)h max(0, yy2 - yy1 1)# compute the ratio of overlap between the computed# bounding box and the bounding box in the area listoverlap float(w * h) / area[j]# if there is sufficient overlap, suppress the# current bounding boxif overlap overlapThresh:suppress.append(pos)# delete all indexes from the index list that are in the# suppression listidxs np.delete(idxs, suppress)# return only the bounding boxes that were pickedreturn boxes[pick]# construct a list containing the images that will be examined # along with their respective bounding boxes images [(images/audrey.jpg, np.array([(12, 84, 140, 212),(24, 84, 152, 212),(36, 84, 164, 212),(12, 96, 140, 224),(24, 96, 152, 224),(24, 108, 152, 236)])),(images/bksomels.jpg, np.array([(114, 60, 178, 124),(120, 60, 184, 124),(114, 66, 178, 130)])),(images/gpripe.jpg, np.array([(12, 30, 76, 94),(12, 36, 76, 100),(72, 36, 200, 164),(84, 48, 212, 176)]))]# loop over the images for (imagePath, boundingBoxes) in images:# load the image and clone itprint [x] %d initial bounding boxes % (len(boundingBoxes))image cv2.imread(imagePath)orig image.copy()# loop over the bounding boxes for each image and draw themfor (startX, startY, endX, endY) in boundingBoxes:cv2.rectangle(orig, (startX, startY), (endX, endY), (0, 0, 255), 2)# perform non-maximum suppression on the bounding boxespick non_max_suppression_slow(boundingBoxes, 0.3)print [x] after applying non-maximum, %d bounding boxes % (len(pick))# loop over the picked bounding boxes and draw themfor (startX, startY, endX, endY) in pick:cv2.rectangle(image, (startX, startY), (endX, endY), (0, 255, 0), 2)# display the imagescv2.imshow(Original, orig)cv2.imshow(After NMS, image)cv2.waitKey(0) 效果如下图
http://www.yutouwan.com/news/387891/

相关文章:

  • 网站报价表建设企业网站收费
  • 网站页码做家装的网站有什么区别
  • wordpress去佛山企业推广优化
  • 温州seo网站推广wordpress获取指定图片大小
  • 手机端网站自动弹出营销qq网店网页制作
  • 德化住房和城乡建设网站风景旅游网页设计
  • 北京建设工程交易信息网站所有网站收录入口
  • 西安专业的网站优化网站域名使用怎么做分录
  • 红叶网站建设方案广西 网站建设
  • 荆门网站开发公司泉州seo网站关键词优
  • 中国电商平台排行榜前十刷神马网站优化排名
  • 建筑业资质查询网站教育网站 前置审批
  • 合伙做网站win2012 iis 部署网站
  • 做微课常用的网站怎么做网站引流
  • 外贸网站多语言如何在百度上找网站
  • 写作网站平台平台型网站如何推广
  • 网站建设官网制作平台室内设计平台接单
  • 网站源码下载炫酷工艺品东莞网站建设
  • 广东做陶瓷的网站优化排名工具
  • 中网自助建站一般通过男网友
  • 安康服务好的网络公司关键词排名优化易下拉软件
  • 备案网站用户名是什么企业logo设计的建议
  • 做毕业网站的周记企业建设网站的功能是什么意思
  • 网站建设pdf微盘福州seo顾问
  • 手机如何制作网站汉口网站建设
  • 专业做涂料网站wordpress不支持中文标签
  • 西安谁家的集团门户网站建设比较好英文网站模板改成中文
  • 做网站和做免费推广网站的区别宁波建设协会网站首页
  • 怎样制作一个网站怎样建设网站施工
  • 给个网站好人有好报wordpress增加类