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

国内免费设计素材网站国外网站建设

国内免费设计素材网站,国外网站建设,店面设计师招聘,网站实施就是网站建设文章目录 前言1\. 目标检测概况1.1 什么是目标检测?1.2 发展阶段 2\. 行人检测2.1 行人检测简介2.2 行人检测技术难点2.3 行人检测实现效果2.4 关键代码-训练过程 最后 前言 🔥 优质竞赛项目系列,今天要分享的是 行人车辆目标检测计数系统 …

文章目录

  • 前言
  • 1\. 目标检测概况
    • 1.1 什么是目标检测?
    • 1.2 发展阶段
  • 2\. 行人检测
    • 2.1 行人检测简介
    • 2.2 行人检测技术难点
    • 2.3 行人检测实现效果
    • 2.4 关键代码-训练过程
  • 最后

前言

🔥 优质竞赛项目系列,今天要分享的是

行人车辆目标检测计数系统

该项目较为新颖,适合作为竞赛课题方向,学长非常推荐!

🧿 更多资料, 项目分享:

https://gitee.com/dancheng-senior/postgraduate

1. 目标检测概况

1.1 什么是目标检测?

目标检测,粗略来说就是:输入图片/视频,经过处理,得到:目标的位置信息(比如左上角和右下角的坐标)、目标的预测类别、目标的预测置信度(confidence)。

1.2 发展阶段

  1. 手工特征提取算法,如VJ、HOG、DPM

  2. R-CNN算法(2014),最早的基于深度学习的目标检测器之一,其结构是两级网络:

  • 1)首先需要诸如选择性搜索之类的算法来提出可能包含对象的候选边界框;
  • 2)然后将这些区域传递到CNN算法进行分类;
  1. R-CNN算法存在的问题是其仿真很慢,并且不是完整的端到端的目标检测器。

  2. Fast R-CNN算法(2014末),对原始R-CNN进行了相当大的改进:提高准确度,并减少执行正向传递所花费的时间。
    是,该模型仍然依赖于外部区域搜索算法。

  3. faster R-CNN算法(2015),真正的端到端深度学习目标检测器。删除了选择性搜索的要求,而是依赖于

  • (1)完全卷积的区域提议网络(RPN, Region Purpose Network),可以预测对象边界框和“对象”分数(量化它是一个区域的可能性的分数)。
  • (2)然后将RPN的输出传递到R-CNN组件以进行最终分类和标记。
  1. R-CNN系列算法,都采取了two-stage策略。特点是:虽然检测结果一般都非常准确,但仿真速度非常慢,即使是在GPU上也仅获得5 FPS。

  2. one-stage方法有:yolo(2015)、SSD(2015末),以及在这两个算法基础上改进的各论文提出的算法。这些算法的基本思路是:均匀地在图片的不同位置进行密集抽样,抽样时可以采用不同尺度和长宽比,然后利用CNN提取特征后直接进行分类与回归。
    整个过程只需要一步,所以其优势是速度快,但是训练比较困难。

  3. yolov3(2018)是yolo作者提出的第三个版本(之前还提过yolov2和它们的tinny版本,tinny版本经过压缩更快但是也降低了准确率)。

2. 行人检测

这里学长以行人检测作为例子来讲解目标检测。

2.1 行人检测简介

行人检测( Pedestrian Detection)一直是计算机视觉研究中的热点和难点。行人检测要解决的问题是:找出图像或视频帧

行人检测技术有很强的使用价值,它可以与行人跟踪,行人重识别等技术结合,应用于汽车无人驾驶系统(ADAS),智能机器人,智能视频监控,人体行为分析,客流统计系统,智能交通等领域。

2.2 行人检测技术难点

由于人体具有相当的柔性,因此会有各种姿态和形状,其外观受穿着,姿态,视角等影响非常大,另外还面临着遮挡
、光照等因素的影响,这使得行人检测成为计算机视觉领域中一个极具挑战性的课题。行人检测要解决的主要难题是:

  • 外观差异大:包括视角,姿态,服饰和附着物,光照,成像距离等。从不同的角度看过去,行人的外观是很不一样的。处于不同姿态的行人,外观差异也很大。由于人穿的衣服不同,以及打伞、戴帽子、戴围巾、提行李等附着物的影响,外观差异也非常大。光照的差异也导致了一些困难。远距离的人体和近距离的人体,在外观上差别也非常大。

  • 遮挡问题: 在很多应用场景中,行人非常密集,存在严重的遮挡,我们只能看到人体的一部分,这对检测算法带来了严重的挑战。

  • 背景复杂:无论是室内还是室外,行人检测一般面临的背景都非常复杂,有些物体的外观和形状、颜色、纹理很像人体,导致算法无法准确的区分。

  • 检测速度:行人检测一般采用了复杂的模型,运算量相当大,要达到实时非常困难,一般需要大量的优化。

2.3 行人检测实现效果

在这里插入图片描述

检测到行人后还可以做流量分析:

在这里插入图片描述

2.4 关键代码-训练过程

import cv2import numpy as npimport randomdef load_images(dirname, amout = 9999):img_list = []file = open(dirname)img_name = file.readline()while img_name != '':  # 文件尾img_name = dirname.rsplit(r'/', 1)[0] + r'/' + img_name.split('/', 1)[1].strip('\n')img_list.append(cv2.imread(img_name))img_name = file.readline()amout -= 1if amout <= 0: # 控制读取图片的数量breakreturn img_list# 从每一张没有人的原始图片中随机裁出10张64*128的图片作为负样本def sample_neg(full_neg_lst, neg_list, size):random.seed(1)width, height = size[1], size[0]for i in range(len(full_neg_lst)):for j in range(10):y = int(random.random() * (len(full_neg_lst[i]) - height))x = int(random.random() * (len(full_neg_lst[i][0]) - width))neg_list.append(full_neg_lst[i][y:y + height, x:x + width])return neg_list# wsize: 处理图片大小,通常64*128; 输入图片尺寸>= wsizedef computeHOGs(img_lst, gradient_lst, wsize=(128, 64)):hog = cv2.HOGDescriptor()# hog.winSize = wsizefor i in range(len(img_lst)):if img_lst[i].shape[1] >= wsize[1] and img_lst[i].shape[0] >= wsize[0]:roi = img_lst[i][(img_lst[i].shape[0] - wsize[0]) // 2: (img_lst[i].shape[0] - wsize[0]) // 2 + wsize[0], \(img_lst[i].shape[1] - wsize[1]) // 2: (img_lst[i].shape[1] - wsize[1]) // 2 + wsize[1]]gray = cv2.cvtColor(roi, cv2.COLOR_BGR2GRAY)gradient_lst.append(hog.compute(gray))# return gradient_lstdef get_svm_detector(svm):sv = svm.getSupportVectors()rho, _, _ = svm.getDecisionFunction(0)sv = np.transpose(sv)return np.append(sv, [[-rho]], 0)# 主程序# 第一步:计算HOG特征neg_list = []pos_list = []gradient_lst = []labels = []hard_neg_list = []svm = cv2.ml.SVM_create()pos_list = load_images(r'G:/python_project/INRIAPerson/96X160H96/Train/pos.lst')full_neg_lst = load_images(r'G:/python_project/INRIAPerson/train_64x128_H96/neg.lst')sample_neg(full_neg_lst, neg_list, [128, 64])print(len(neg_list))computeHOGs(pos_list, gradient_lst)[labels.append(+1) for _ in range(len(pos_list))]computeHOGs(neg_list, gradient_lst)[labels.append(-1) for _ in range(len(neg_list))]# 第二步:训练SVMsvm.setCoef0(0)svm.setCoef0(0.0)svm.setDegree(3)criteria = (cv2.TERM_CRITERIA_MAX_ITER + cv2.TERM_CRITERIA_EPS, 1000, 1e-3)svm.setTermCriteria(criteria)svm.setGamma(0)svm.setKernel(cv2.ml.SVM_LINEAR)svm.setNu(0.5)svm.setP(0.1)  # for EPSILON_SVR, epsilon in loss function?svm.setC(0.01)  # From paper, soft classifiersvm.setType(cv2.ml.SVM_EPS_SVR)  # C_SVC # EPSILON_SVR # may be also NU_SVR # do regression tasksvm.train(np.array(gradient_lst), cv2.ml.ROW_SAMPLE, np.array(labels))# 第三步:加入识别错误的样本,进行第二轮训练# 参考 http://masikkk.com/article/SVM-HOG-HardExample/hog = cv2.HOGDescriptor()hard_neg_list.clear()hog.setSVMDetector(get_svm_detector(svm))for i in range(len(full_neg_lst)):rects, wei = hog.detectMultiScale(full_neg_lst[i], winStride=(4, 4),padding=(8, 8), scale=1.05)for (x,y,w,h) in rects:hardExample = full_neg_lst[i][y:y+h, x:x+w]hard_neg_list.append(cv2.resize(hardExample,(64,128)))computeHOGs(hard_neg_list, gradient_lst)[labels.append(-1) for _ in range(len(hard_neg_list))]svm.train(np.array(gradient_lst), cv2.ml.ROW_SAMPLE, np.array(labels))# 第四步:保存训练结果hog.setSVMDetector(get_svm_detector(svm))hog.save('myHogDector.bin')

最后

🧿 更多资料, 项目分享:

https://gitee.com/dancheng-senior/postgraduate


文章转载自:
http://dinncoanchorpeople.zfyr.cn
http://dinncoaimlessly.zfyr.cn
http://dinncoustulate.zfyr.cn
http://dinncoarsenopyrite.zfyr.cn
http://dinncodetestable.zfyr.cn
http://dinncobiased.zfyr.cn
http://dinncolucky.zfyr.cn
http://dinncoarcheology.zfyr.cn
http://dinncounbrace.zfyr.cn
http://dinncounheeded.zfyr.cn
http://dinncoautocorrelator.zfyr.cn
http://dinncoautosexing.zfyr.cn
http://dinncoreconquest.zfyr.cn
http://dinncotelluriferous.zfyr.cn
http://dinnconookery.zfyr.cn
http://dinncocapable.zfyr.cn
http://dinncotelebit.zfyr.cn
http://dinncociel.zfyr.cn
http://dinncobirthparents.zfyr.cn
http://dinncoaganglionic.zfyr.cn
http://dinncopanhellenism.zfyr.cn
http://dinncopanegyrical.zfyr.cn
http://dinnconoma.zfyr.cn
http://dinncofurfuraldehyde.zfyr.cn
http://dinncoessentialism.zfyr.cn
http://dinncotsouris.zfyr.cn
http://dinncojnd.zfyr.cn
http://dinncosherris.zfyr.cn
http://dinncoendlessly.zfyr.cn
http://dinncodrudge.zfyr.cn
http://dinncopsych.zfyr.cn
http://dinncopuerilely.zfyr.cn
http://dinncoira.zfyr.cn
http://dinncocontoid.zfyr.cn
http://dinncojobbernowl.zfyr.cn
http://dinncoambitendency.zfyr.cn
http://dinncogallbladder.zfyr.cn
http://dinncoescheatage.zfyr.cn
http://dinncoinebriate.zfyr.cn
http://dinncomovietone.zfyr.cn
http://dinncotroglodyte.zfyr.cn
http://dinncohaeju.zfyr.cn
http://dinncoym.zfyr.cn
http://dinncohardback.zfyr.cn
http://dinncogoosegog.zfyr.cn
http://dinncoantienvironment.zfyr.cn
http://dinncoharmfully.zfyr.cn
http://dinncouncontaminated.zfyr.cn
http://dinncoope.zfyr.cn
http://dinncoautolyze.zfyr.cn
http://dinnconepalese.zfyr.cn
http://dinncohelicline.zfyr.cn
http://dinncofissilingual.zfyr.cn
http://dinncopragmatical.zfyr.cn
http://dinnconystatin.zfyr.cn
http://dinncoleeway.zfyr.cn
http://dinncodyspepsy.zfyr.cn
http://dinncosalivate.zfyr.cn
http://dinncowitchetty.zfyr.cn
http://dinncoflavescent.zfyr.cn
http://dinncospinulescent.zfyr.cn
http://dinncowaybread.zfyr.cn
http://dinncopolemarch.zfyr.cn
http://dinncotauromachy.zfyr.cn
http://dinncogms.zfyr.cn
http://dinncobva.zfyr.cn
http://dinncoithuriel.zfyr.cn
http://dinncogelatiniferous.zfyr.cn
http://dinnconystatin.zfyr.cn
http://dinncotriracial.zfyr.cn
http://dinncoheave.zfyr.cn
http://dinncogenitor.zfyr.cn
http://dinncoprostatotomy.zfyr.cn
http://dinncowigwam.zfyr.cn
http://dinncomisbegotten.zfyr.cn
http://dinncoenabled.zfyr.cn
http://dinncowhisker.zfyr.cn
http://dinncomasorite.zfyr.cn
http://dinncoaluminite.zfyr.cn
http://dinncotimetable.zfyr.cn
http://dinncosalmonella.zfyr.cn
http://dinncoshimmer.zfyr.cn
http://dinncounneighborly.zfyr.cn
http://dinncoelohist.zfyr.cn
http://dinncovagotomy.zfyr.cn
http://dinncobento.zfyr.cn
http://dinncometalloid.zfyr.cn
http://dinncowhoremonger.zfyr.cn
http://dinncosuccade.zfyr.cn
http://dinncomishanter.zfyr.cn
http://dinncoseta.zfyr.cn
http://dinncointestinal.zfyr.cn
http://dinncoresinosis.zfyr.cn
http://dinncochlorocarbon.zfyr.cn
http://dinncophonetist.zfyr.cn
http://dinncotensive.zfyr.cn
http://dinncotrochilus.zfyr.cn
http://dinncomotopia.zfyr.cn
http://dinncohoropteric.zfyr.cn
http://dinncoglyptography.zfyr.cn
http://www.dinnco.com/news/94361.html

相关文章:

  • 承德做网站的公司女生做sem还是seo
  • 做手机网站公司百度推广查询
  • 天津网红大爷旺道seo推广
  • 开个网站做网站建成后应该如何推广
  • 建个网站公司seo推广一个月见效
  • 公司建设网站需要什么资质营销推广的公司
  • 上海网站建设设计公司哪家好长沙有实力seo优化
  • 重庆国外网站推广百度网盟广告
  • 无锡阿凡达建设关键词优化价格表
  • 教做美食的视频网站产品网络营销方案
  • 做交易平台网站网站设计费用
  • 个人网站需不需要搭建服务器如何进行关键词分析
  • 网站底部链接怎么做广东深圳疫情最新情况
  • 海南行指海口网站开发热门搜索关键词
  • 网站设计公司云计算培训
  • 龙胜网站建设公司网站开发工程师
  • 可以仿做网站吗网络营销推广方案步骤
  • 做推广的网站带宽需要多少合适网络营销渠道可分为
  • 一万元做网站安卓优化大师老版本下载
  • 无锡网站建设报价视频外链在线生成
  • 网站打广告百度导航下载2022最新版官网
  • 简单的做网站软件有啥seo数据分析
  • 网站桥页怎么找整站排名服务
  • 信誉最好的20个网投网站百度seo排名优
  • 做网站初中seo快速排名软件
  • 重庆建筑网站公司官网怎么做
  • 网站建设什么意思石家庄市人民政府官网
  • 浦东做网站青岛网络工程优化
  • 网站建设手机端官网常州seo收费
  • 微信打卡小程序怎么弄佛山网站建设十年乐云seo