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

ppt下载网站哪个好解析软件的网站

ppt下载网站哪个好,解析软件的网站,企业网站的建设的目标人物是,自己做充值网站本系列文章记录本人硕士阶段YOLO系列目标检测算法自学及其代码实现的过程。其中算法具体实现借鉴于ultralytics YOLO源码Github#xff0c;删减了源码中部分内容#xff0c;满足个人科研需求。   本系列文章主要以YOLOv5为例完成算法的实现#xff0c;后续修改、增加相关模…   本系列文章记录本人硕士阶段YOLO系列目标检测算法自学及其代码实现的过程。其中算法具体实现借鉴于ultralytics YOLO源码Github删减了源码中部分内容满足个人科研需求。   本系列文章主要以YOLOv5为例完成算法的实现后续修改、增加相关模块即可实现其他版本的YOLO算法。 文章地址 YOLOv5算法实现(一)算法框架概述 YOLOv5算法实现(二)模型加载 YOLOv5算法实现(三)数据集加载 YOLOv5算法实现(四)正样本匹配与损失计算 YOLOv5算法实现(五)预测结果后处理 YOLOv5算法实现(六)评价指标及实现 YOLOv5算法实现(七)模型训练 YOLOv5算法实现(八)模型验证 YOLOv5算法实现(九)模型预测 本文目录 引言模型预测(predict.py) 引言 本篇文章综合之前文章中的功能实现模型的预测。模型预测的逻辑如图1所示。 图1 模型预测流程 模型预测(predict.py) def predice():img_size 640 # 必须是32的整数倍 [416, 512, 608]file yolov5scfg fcfg/models/{file}.yaml # 改成生成的.cfg文件weights_path fweights/{file}/{file}.pt # 改成自己训练好的权重文件json_path data/dataset.json # json标签文件img_path test.jpgsave_path fresults/{file}/test_result8.jpgassert os.path.exists(cfg), cfg file {} dose not exist..format(cfg)assert os.path.exists(weights_path), weights file {} dose not exist..format(weights_path)assert os.path.exists(json_path), json file {} dose not exist..format(json_path)assert os.path.exists(img_path), image file {} dose not exist..format(img_path)with open(json_path, r) as f:class_dict json.load(f)category_index {str(v): str(k) for k, v in class_dict.items()}input_size (img_size, img_size)device torch.device(cuda:0 if torch.cuda.is_available() else cpu)device torch.device(cpu)model Model(cfg, ch3, nc3)weights_dict torch.load(weights_path, map_locationcpu)weights_dict weights_dict[model] if model in weights_dict else weights_dictmodel.load_state_dict(weights_dict, strictFalse)model.to(device)model.eval()with torch.no_grad():# initimg torch.zeros((1, 3, img_size, img_size), devicedevice)model(img)img_o cv2.imread(img_path) # BGRassert img_o is not None, Image Not Found img_pathimg letterbox(img_o, new_shapeinput_size, autoTrue, color(0, 0, 0))[0]# Convertimg img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB, to 3x416x416img np.ascontiguousarray(img)img torch.from_numpy(img).to(device).float()img / 255.0 # scale (0, 255) to (0, 1)img img.unsqueeze(0) # add batch dimensiont1 torch_utils.time_synchronized()pred model(img)[0] # only get inference resultt2 torch_utils.time_synchronized()print(inference time: {}s.format(t2 - t1))print(model: {}.format(file))pred utils.non_max_suppression(pred, conf_thres0.1, iou_thres0.6, multi_labelTrue)[0]t3 time.time()print(post-processing time: {}s.format(t3 - t2))# process detectionspred[:, :4] utils.scale_coords(img.shape[2:], pred[:, :4], img_o.shape).round()bboxes pred[:, :4].detach().cpu().numpy()scores pred[:, 4].detach().cpu().numpy()classes pred[:, 5].detach().cpu().numpy().astype(np.int) 1pil_img Image.fromarray(img_o[:, :, ::-1])plot_img draw_objs(pil_img,bboxes,classes,scores,category_indexcategory_index,box_thresh0.2,line_thickness3,fontarial.ttf,font_size30)plt.imshow(plot_img)plt.show()# 保存预测的图片结果plot_img.save(save_path)if __name__ __main__:predict()
http://www.hkea.cn/news/14510323/

相关文章:

  • 网站建设速成班培训建设网站要钱么
  • 做仿牌网站国家企业信用公示信息网
  • 做瞹瞹小视频网站陕西省门户网站建设政策
  • 专业返利网站建设企业网站建设河北
  • seo企业站收录在wordpress 需要购买服务器吗
  • 泉州自助建站软件wordpress 响应式 企业网站
  • 微网站内页临沂制作网站多少钱
  • 网站推广工具工作室专业网站设计开发公司
  • 学校要求做网站wordpress 视频 批量
  • 企业网站的首页设计浙江网站制作公司
  • 网站建设制作设计营销 大连青海省西宁市住房城乡建设厅网站
  • 贵州省住房和城乡建设厅网站首页微信公众号私自建设电影网站
  • 莱州免费发布信息的网站平台企业公司网站建设
  • 北京通州住房和城乡建设部网站建设部网站焊工证件查询
  • 如何上传网站多平台管理系统
  • 广东网站建设定制高端网站建设找哪个公司
  • 肥城市网站建设越南建设部网站
  • 如何ps做网站首页受欢迎的昆明网站推广
  • 洛阳网站公司装修设计培训学校
  • 中国建设银行网上银行官方网站已注册商标查询官网
  • 建设牌安全带官方网站杭州做网站比较好的公司
  • 南阳网站托管动漫技术制作专业
  • wordpress建站需要学什么西安做营销型网站
  • 政务公开网站开发企业年金个人查询官网
  • 网站开发做什么的常州网站建设运营
  • 网站模块功能关于网站建设电话销售的话术
  • 专门做文创产品的网站企业网站怎么搭建
  • 网站模板 jspwordpress主题外贸网站
  • 商务网站前台模板网页游戏排行榜百战沙城
  • 做网站的系统功能需求企业标志设计公司