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

电子商务企业 网站前台建设 苏宁住房和城乡建设部网站干部学院

电子商务企业 网站前台建设 苏宁,住房和城乡建设部网站干部学院,wordpress禁用wp-cron,商贸有限公司章程范本程序示例精选 PythonYolov8onnx-deepsort方法物体人流量识别统计 如需安装运行环境或远程调试#xff0c;见文章底部个人QQ名片#xff0c;由专业技术人员远程协助#xff01; 前言 这篇博客针对《PythonYolov8onnx-deepsort方法物体人流量识别统计》编写代码#xff0c;… 程序示例精选 PythonYolov8onnx-deepsort方法物体人流量识别统计 如需安装运行环境或远程调试见文章底部个人QQ名片由专业技术人员远程协助 前言 这篇博客针对《PythonYolov8onnx-deepsort方法物体人流量识别统计》编写代码代码整洁规则易读。 学习与应用推荐首选。 运行结果 文章目录 一、所需工具软件 二、使用步骤        1. 主要代码        2. 运行结果 三、在线协助 一、所需工具软件 1. Python        2. Pycharm 二、使用步骤 代码如下示例 import cv2 from yolov8 import YOLOv8 from deep_sort_pytorch.deep_sort import DeepSort from deep_sort_pytorch.utils.parser import get_config from collections import deque def init_tracker():print(init_tracker)global deepsortcfg_deep get_config()cfg_deep.merge_from_file(deep_sort_pytorch/configs/deep_sort.yaml)deepsort DeepSort(cfg_deep.DEEPSORT.REID_CKPT,max_distcfg_deep.DEEPSORT.MAX_DIST, min_confidencecfg_deep.DEEPSORT.MIN_CONFIDENCE,nms_max_overlapcfg_deep.DEEPSORT.NMS_MAX_OVERLAP, max_iou_distancecfg_deep.DEEPSORT.MAX_IOU_DISTANCE,max_agecfg_deep.DEEPSORT.MAX_AGE, n_initcfg_deep.DEEPSORT.N_INIT, nn_budgetcfg_deep.DEEPSORT.NN_BUDGET,use_cudaTrue) ########################################################################################## def xyxy_to_xywh(*xyxy): Calculates the relative bounding box from absolute pixel values. bbox_left min([xyxy[0].item(), xyxy[2].item()])bbox_top min([xyxy[1].item(), xyxy[3].item()])bbox_w abs(xyxy[0].item() - xyxy[2].item())bbox_h abs(xyxy[1].item() - xyxy[3].item())x_c (bbox_left bbox_w / 2)y_c (bbox_top bbox_h / 2)w bbox_wh bbox_hreturn x_c, y_c, w, hdef xyxy_to_tlwh(bbox_xyxy):tlwh_bboxs []for i, box in enumerate(bbox_xyxy):x1, y1, x2, y2 [int(i) for i in box]top x1left y1w int(x2 - x1)h int(y2 - y1)tlwh_obj [top, left, w, h]tlwh_bboxs.append(tlwh_obj)return tlwh_bboxsdef compute_color_for_labels(label):Simple function that adds fixed color depending on the classif label 0: #personcolor (85,45,255)elif label 2: # Carcolor (222,82,175)elif label 3: # Motobikecolor (0, 204, 255)elif label 5: # Buscolor (0, 149, 255)else:color [int((p * (label ** 2 - label 1)) % 255) for p in palette]return tuple(color)def draw_border(img, pt1, pt2, color, thickness, r, d):x1,y1 pt1x2,y2 pt2# Top leftcv2.line(img, (x1 r, y1), (x1 r d, y1), color, thickness)cv2.line(img, (x1, y1 r), (x1, y1 r d), color, thickness)cv2.ellipse(img, (x1 r, y1 r), (r, r), 180, 0, 90, color, thickness)# Top rightcv2.line(img, (x2 - r, y1), (x2 - r - d, y1), color, thickness)cv2.line(img, (x2, y1 r), (x2, y1 r d), color, thickness)cv2.ellipse(img, (x2 - r, y1 r), (r, r), 270, 0, 90, color, thickness)# Bottom leftcv2.line(img, (x1 r, y2), (x1 r d, y2), color, thickness)cv2.line(img, (x1, y2 - r), (x1, y2 - r - d), color, thickness)cv2.ellipse(img, (x1 r, y2 - r), (r, r), 90, 0, 90, color, thickness)# Bottom rightcv2.line(img, (x2 - r, y2), (x2 - r - d, y2), color, thickness)cv2.line(img, (x2, y2 - r), (x2, y2 - r - d), color, thickness)cv2.ellipse(img, (x2 - r, y2 - r), (r, r), 0, 0, 90, color, thickness)cv2.rectangle(img, (x1 r, y1), (x2 - r, y2), color, -1, cv2.LINE_AA)cv2.rectangle(img, (x1, y1 r), (x2, y2 - r - d), color, -1, cv2.LINE_AA)cv2.circle(img, (x1 r, y1r), 2, color, 12)cv2.circle(img, (x2 -r, y1r), 2, color, 12)cv2.circle(img, (x1 r, y2-r), 2, color, 12)cv2.circle(img, (x2 -r, y2-r), 2, color, 12)return imgdef UI_box(x, img, colorNone, labelNone, line_thicknessNone):# Plots one bounding box on image imgtl line_thickness or round(0.002 * (img.shape[0] img.shape[1]) / 2) 1 # line/font thicknesscolor color or [random.randint(0, 255) for _ in range(3)]c1, c2 (int(x[0]), int(x[1])), (int(x[2]), int(x[3]))def intersect(A,B,C,D):return ccw(A,C,D) ! ccw(B,C,D) and ccw(A,B,C) ! ccw(A,B,D)def ccw(A,B,C):return (C[1]-A[1]) * (B[0]-A[0]) (B[1]-A[1]) * (C[0]-A[0])def get_direction(point1, point2):direction_str def draw_boxes(img, bbox, names,object_id, identitiesNone, offset(0, 0)):cv2.line(img, line[0], line[1], (0,0,255), 3)height, width, _ img.shape# remove tracked point from buffer if object is lostfor key in list(data_deque):if key not in identities:data_deque.pop(key)for i, box in enumerate(bbox):x1, y1, x2, y2 [int(i) for i in box]x1 offset[0]x2 offset[0]y1 offset[1]y2 offset[1]# code to find center of bottom edgecenter (int((x2x1)/ 2), int((y2y2)/2))# get ID of objectid int(identities[i]) if identities is not None else 0# create new buffer for new objectif id not in data_deque: data_deque[id] deque(maxlen 64)color compute_color_for_labels(object_id[i])obj_name names[object_id[i]]label {}{:d}.format(, id) : %s % (obj_name)# add center to bufferdata_deque[id].appendleft(center)if len(data_deque[id]) 2:direction get_direction(data_deque[id][0], data_deque[id][1])if intersect(data_deque[id][0], data_deque[id][1], line[0], line[1]):cv2.line(img, line[0], line[1], (255, 255, 255), 3)if South in direction:if obj_name not in object_counter:object_counter[obj_name] 1else:object_counter[obj_name] 1if North in direction:if obj_name not in object_counter1:object_counter1[obj_name] 1else:object_counter1[obj_name] 1UI_box(box, img, labellabel, colorcolor, 运行结果 三、在线协助 如需安装运行环境或远程调试见文章底部个人 QQ 名片由专业技术人员远程协助 1远程安装运行环境代码调试 2Visual Studio, Qt, C, Python编程语言入门指导 3界面美化 4软件制作 5云服务器申请 6网站制作 当前文章连接https://blog.csdn.net/alicema1111/article/details/132666851 个人博客主页https://blog.csdn.net/alicema1111?typeblog 博主所有文章点这里https://blog.csdn.net/alicema1111?typeblog 博主推荐 Python人脸识别考勤打卡系统 https://blog.csdn.net/alicema1111/article/details/133434445 Python果树水果识别https://blog.csdn.net/alicema1111/article/details/130862842 PythonYolov8Deepsort入口人流量统计https://blog.csdn.net/alicema1111/article/details/130454430 PythonQt人脸识别门禁管理系统https://blog.csdn.net/alicema1111/article/details/130353433 PythonQt指纹录入识别考勤系统https://blog.csdn.net/alicema1111/article/details/129338432 Python Yolov5火焰烟雾识别源码分享https://blog.csdn.net/alicema1111/article/details/128420453 PythonYolov8路面桥梁墙体裂缝识别https://blog.csdn.net/alicema1111/article/details/133434445
http://www.zqtcl.cn/news/643114/

相关文章:

  • 摄影网站在线建设办公室设计装修
  • 深圳市移动端网站建设游戏网站建设与策划方案
  • wap版网站 加app提示厦门网站seo优化
  • 旅游网站 功能建设银行网站会员
  • 公园网站建设wordpress 分类目录使用英文
  • 苏州高端网站设计制作wordpress改固定连接
  • 门户网站开源sae安装wordpress
  • 建设彩票网站需要哪些要求城乡与住房建设厅网站首页
  • 公司做网站费用计入什么科目网络建设规划
  • 外贸网站建设案例深圳设计网站培训
  • 龙岗地区做网站公司北京装饰公司排行 2019
  • 大企业网站建设方案wordpress博客模板查询
  • 手机网站建设动态公司做网站效果怎么样
  • 网站推广和优化教程上海网络科技有限公司招聘
  • 即墨建网站价格商城二次开发
  • 网站排名易下拉教程怎么做网店运营
  • 聊城做网站公司聊城博达海外服务器租用多少钱一年
  • 手机上网站做国外销售都上什么网站
  • 网站建设与管理报告书做电销有什么资料网站
  • 网站建设哪家最好企业商城网站建设方案
  • 舟山市建设工程质量监督站网站网页版微信二维码加载失败
  • 金融网站html5模板给自己家的公司做网站好做吗
  • 新农村建设投诉在哪个网站上海做电缆桥架的公司网站
  • 免费行情100个软件网络优化论文
  • asp.net动态的网站开发个人业务网站带后台
  • 控制网站的大量访问关于实验室建设的英文网站
  • 中国容桂品牌网站建设怎么自己做个网站做链接跳转
  • 安徽省建设工程协会网站昆明官网seo厂家
  • 品牌整合推广搜狗优化好的网站
  • 娄底手机网站制作深圳网站建设怎么做