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

网站上飘窗怎么做seo推广哪家服务好

网站上飘窗怎么做,seo推广哪家服务好,网页制作模板如何制作,纹身网站建设案例项目实验结果展示: 基于yolo v5与Deep Sort进行车辆以及速度检测与目标跟踪实战——项目可以私聊 该项目可以作为毕业设计,以及企业级的项目开发,主要包含了车辆的目标检测、目标跟踪以及车辆的速度计算,同样可以进行二次开发。 …

项目实验结果展示:

基于yolo v5与Deep Sort进行车辆以及速度检测与目标跟踪实战——项目可以私聊

该项目可以作为毕业设计,以及企业级的项目开发,主要包含了车辆的目标检测、目标跟踪以及车辆的速度计算,同样可以进行二次开发。

这里附上主要的检测代码

import torch
import numpy as np
from models.experimental import attempt_load
from utils.general import non_max_suppression, scale_coords
from utils.torch_utils import select_device
from utils.datasets import letterbox
import cv2
from deep_sort.utils.parser import get_config
from deep_sort.deep_sort import DeepSort
from haversine import haversine, Unit
from sys import platform as _platformclass Detector:"""yolo目标检测"""def __init__(self):self.img_size = 1280self.conf_thres = 0.5self.iou_thres=0.5# 目标检测权重self.weights = 'weights/highway_m_300.pt'self.device = '0' if torch.cuda.is_available() else 'cpu'self.device = select_device(self.device)model = attempt_load(self.weights, map_location=self.device)model.to(self.device).eval()# 判断系统,支持MACOS 和 windowsif _platform == "darwin":# MAC OS Xmodel.float()else:# Windowsmodel.half()# self.m = modelself.names = model.module.names if hasattr(model, 'module') else model.names# 图片预处理def preprocess(self, img):img = letterbox(img, new_shape=self.img_size)[0]img = img[:, :, ::-1].transpose(2, 0, 1)img = np.ascontiguousarray(img)img = torch.from_numpy(img).to(self.device)if _platform == "darwin":# MAC OS Ximg = img.float() else:# Windowsimg = img.half()img /= 255.0  # 图像归一化if img.ndimension() == 3:img = img.unsqueeze(0)return img# 目标检测def yolo_detect(self, im):img = self.preprocess(im)pred = self.m(img, augment=False)[0]pred = pred.float()pred = non_max_suppression(pred, self.conf_thres, self.iou_thres )pred_boxes = []for det in pred:if det is not None and len(det):det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im.shape).round()for *x, conf, cls_id in det:lbl = self.names[int(cls_id)]x1, y1 = int(x[0]), int(x[1])x2, y2 = int(x[2]), int(x[3])pred_boxes.append((x1, y1, x2, y2, lbl, conf))return pred_boxesclass Tracker:"""deepsort追踪"""def __init__(self):cfg = get_config()cfg.merge_from_file("deep_sort/configs/deep_sort.yaml")self.deepsort = DeepSort(cfg.DEEPSORT.REID_CKPT,max_dist=cfg.DEEPSORT.MAX_DIST, min_confidence=cfg.DEEPSORT.MIN_CONFIDENCE,nms_max_overlap=cfg.DEEPSORT.NMS_MAX_OVERLAP, max_iou_distance=cfg.DEEPSORT.MAX_IOU_DISTANCE,max_age=cfg.DEEPSORT.MAX_AGE, n_init=cfg.DEEPSORT.N_INIT, nn_budget=cfg.DEEPSORT.NN_BUDGET,use_cuda=True)def update_tracker(self,image, yolo_bboxes):bbox_xywh = []confs = []clss = []for x1, y1, x2, y2, cls_id, conf in yolo_bboxes:obj = [int((x1+x2)/2), int((y1+y2)/2),x2-x1, y2-y1]bbox_xywh.append(obj)confs.append(conf)clss.append(cls_id)xywhs = torch.Tensor(bbox_xywh)confss = torch.Tensor(confs)#更新追踪结果outputs = self.deepsort.update(xywhs, confss, clss, image)bboxes2draw = []for value in list(outputs):x1, y1, x2, y2, cls_, track_id = valuebboxes2draw.append((x1, y1, x2, y2, cls_, track_id))return bboxes2drawclass PixelMapper(object):"""Create an object for converting pixels to geographic coordinates,using four points with known locations which form a quadrilteral in both planesParameters----------pixel_array : (4,2) shape numpy arrayThe (x,y) pixel coordinates corresponding to the top left, top right, bottom right, bottom leftpixels of the known regionlonlat_array : (4,2) shape numpy arrayThe (lon, lat) coordinates corresponding to the top left, top right, bottom right, bottom leftpixels of the known region"""def __init__(self, pixel_array, lonlat_array):assert pixel_array.shape==(4,2), "Need (4,2) input array"assert lonlat_array.shape==(4,2), "Need (4,2) input array"self.M = cv2.getPerspectiveTransform(np.float32(pixel_array),np.float32(lonlat_array))self.invM = cv2.getPerspectiveTransform(np.float32(lonlat_array),np.float32(pixel_array))def pixel_to_lonlat(self, pixel):"""Convert a set of pixel coordinates to lon-lat coordinatesParameters----------pixel : (N,2) numpy array or (x,y) tupleThe (x,y) pixel coordinates to be convertedReturns-------(N,2) numpy arrayThe corresponding (lon, lat) coordinates"""if type(pixel) != np.ndarray:pixel = np.array(pixel).reshape(1,2)assert pixel.shape[1]==2, "Need (N,2) input array" pixel = np.concatenate([pixel, np.ones((pixel.shape[0],1))], axis=1)lonlat = np.dot(self.M,pixel.T)return (lonlat[:2,:]/lonlat[2,:]).Tdef lonlat_to_pixel(self, lonlat):"""Convert a set of lon-lat coordinates to pixel coordinatesParameters----------lonlat : (N,2) numpy array or (x,y) tupleThe (lon,lat) coordinates to be convertedReturns-------(N,2) numpy arrayThe corresponding (x, y) pixel coordinates"""if type(lonlat) != np.ndarray:lonlat = np.array(lonlat).reshape(1,2)assert lonlat.shape[1]==2, "Need (N,2) input array" lonlat = np.concatenate([lonlat, np.ones((lonlat.shape[0],1))], axis=1)pixel = np.dot(self.invM,lonlat.T)return (pixel[:2,:]/pixel[2,:]).Tclass SpeedEstimate:def __init__(self):# 配置相机画面与地图的映射点,需要根据自己镜头和地图上的点重新配置quad_coords = {"lonlat": np.array([[30.221866, 120.287402], # top left[30.221527,120.287632], # top right[30.222098,120.285806], # bottom left[30.221805,120.285748] # bottom right]),"pixel": np.array([[196,129],# top left[337,111], # top right[12,513], # bottom left[530,516] # bottom right])}self.pm = PixelMapper(quad_coords["pixel"], quad_coords["lonlat"])def pixel2lonlat(self,x,y):# 像素坐标转为经纬度return self.pm.pixel_to_lonlat((x,y))[0]def pixelDistance(self,pa_x,pa_y,pb_x,pb_y):# 相机画面两点在地图上实际的距离lonlat_a = self.pm.pixel_to_lonlat((pa_x,pa_y))lonlat_b = self.pm.pixel_to_lonlat((pb_x,pb_y))lonlat_a = tuple(lonlat_a[0])lonlat_b = tuple(lonlat_b[0])return haversine(lonlat_a, lonlat_b, unit='m')

项目需求+V: gldz_super   

http://www.hkea.cn/news/934196/

相关文章:

  • 网站建设 摄影服务上海seo网站排名优化公司
  • 网页设计中html代码seo博客网站
  • 怎样建设小游戏网站google关键词搜索技巧
  • 淘宝 客要推广网站怎么做全媒体广告代理
  • 那个b2b网站可以做外贸武汉全网推广
  • 深圳css3网站开发多少钱如何策划一个营销方案
  • 织梦统计网站访问量代码网络营销公司如何建立
  • 外贸营销型网站建设今日最新重大新闻
  • 个性化定制网站长春网络推广优化
  • 合肥庐阳区疫情最新消息seo优化首页
  • h5网站制作接单最新中高风险地区名单
  • 北京市住房城乡建设委网站公司怎么在网上推广
  • 网站建设首页怎样插入视频百度指数在线查询小程序
  • 青州网站制作哪家好aso优化哪家好
  • wordpress做网站优点郑州网站seo优化
  • 宝安做棋牌网站建设找哪家公司好湖南长沙疫情最新消息
  • 四川专业网站建设中国十大企业培训机构排名
  • 怎么切页面做网站灰色词首页排名接单
  • 网站右侧浮动广告代码百度推广代理公司广州
  • 固原建站公司旺道seo推广系统怎么收费
  • 适合做外链的网站海外广告联盟平台推广
  • 建筑模板规格型号郑州厉害的seo顾问
  • ppt做书模板下载网站有哪些内容国际婚恋网站排名
  • 上海网站建设内容更新网络营销策划目的
  • 重庆市建设信息网站关键词查询网
  • 做哪种网站流量大怎么打广告宣传自己的产品
  • 免费表白网站制作seo网络优化推广
  • 网站建设中可能升级中国科技新闻网
  • 网站制作内容文案网站如何快速被百度收录
  • 淘宝淘宝网页版登录入口免费seo公司