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

文字网站和图片网站哪个难做苏州 网站的公司

文字网站和图片网站哪个难做,苏州 网站的公司,wordpress seo文件,枣庄哪里有做网站设计在人工智能和计算机视觉领域,YOLO(You Only Look Once)是一种广泛使用的实时目标检测算法。为了直观地展示YOLO算法的检测效果,我们使用Pyqt框架进行检测结果的可视化,同时为了使其能够脱离Python环境,我们…

在人工智能和计算机视觉领域,YOLO(You Only Look Once)是一种广泛使用的实时目标检测算法。为了直观地展示YOLO算法的检测效果,我们使用Pyqt框架进行检测结果的可视化,同时为了使其能够脱离Python环境,我们将模型文件转换为ONNX格式,并使用nuitka进行打包。

界面展示

为了使系统更加完备,采用SQLite数据库,设计登录注册、图像检测、视频检测、相机实时检测、模型更换等功能,效果如下:

在这里插入图片描述

如下图所示:其左侧为功能区,中间为展示区,右侧上方展示检测结果,下方为日志记录。

在这里插入图片描述

nuitka打包

我们要使python项目脱离python环境,可以选择将其打包为exe文件,当前比较主流的打包方式是采用pyinstaller的方式,但这种打包方式的执行效率相对较低,而nuitka的打包方式将python代码转换为C代码,执行速度更快,且更安全。

nuitka --standalone --enable-plugin=qt-plugins --windows-disable-console --follow-imports --show-memory --show-progress --output-dir=dist login.py

在这里插入图片描述

ONNX推理

下面是YOLODet目标检测的代码,涉及模型加载、前处理、模型推理、后处理、绘图。

import time
import cv2
import numpy as np
import onnxruntime
from utils import xywh2xyxy, multiclass_nms,detections_dog
class YOLODet:#初始化YOLO模型def __init__(self, path, conf_thres=0.7, iou_thres=0.5):self.conf_threshold = conf_thresself.iou_threshold = iou_thresself.initialize_model(path)#调用推理def __call__(self, image):return self.detect_objects(image)def initialize_model(self, path):self.session = onnxruntime.InferenceSession(path,providers=onnxruntime.get_available_providers())self.get_input_details()self.get_output_details()#执行模型推理过程def detect_objects(self, image):input_tensor = self.prepare_input(image)outputs = self.inference(input_tensor)self.boxes, self.scores, self.class_ids = self.process_output(outputs)return self.boxes, self.scores, self.class_ids#前处理操作def prepare_input(self, image):self.img_height, self.img_width = image.shape[:2]input_img = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)input_img = cv2.resize(input_img, (self.input_width, self.input_height))input_img = input_img / 255.0input_img = input_img.transpose(2, 0, 1)input_tensor = input_img[np.newaxis, :, :, :].astype(np.float32)return input_tensor#具体使用onnx推理def inference(self, input_tensor):outputs = self.session.run(self.output_names, {self.input_names[0]: input_tensor})return outputs#后处理操作def process_output(self, output):predictions = np.squeeze(output[0]).Tscores = np.max(predictions[:, 4:], axis=1)predictions = predictions[scores > self.conf_threshold, :]scores = scores[scores > self.conf_threshold]if len(scores) == 0:return [], [], []class_ids = np.argmax(predictions[:, 4:], axis=1)boxes = self.extract_boxes(predictions)indices = multiclass_nms(boxes, scores, class_ids, self.iou_threshold)return boxes[indices], scores[indices], class_ids[indices]#box转换,包含尺度变换与xywh转换def extract_boxes(self, predictions):boxes = predictions[:, :4]boxes = self.rescale_boxes(boxes)boxes = xywh2xyxy(boxes)return boxes#尺度变换def rescale_boxes(self, boxes):input_shape = np.array([self.input_width, self.input_height, self.input_width, self.input_height])boxes = np.divide(boxes, input_shape, dtype=np.float32)boxes *= np.array([self.img_width, self.img_height, self.img_width, self.img_height])return boxes#绘制图像def draw_detections(self, image, draw_scores=True, mask_alpha=0.4):return detections_dog(image, self.boxes, self.scores,self.class_ids, mask_alpha)def get_input_details(self):model_inputs = self.session.get_inputs()self.input_names = [model_inputs[i].name for i in range(len(model_inputs))]self.input_shape = model_inputs[0].shapeself.input_height = self.input_shape[2]self.input_width = self.input_shape[3]def get_output_details(self):model_outputs = self.session.get_outputs()self.output_names = [model_outputs[i].name for i in range(len(model_outputs))]

文章转载自:

http://fIkvvofI.cLndL.cn
http://kmlXw80g.cLndL.cn
http://xNo9KIp1.cLndL.cn
http://eMcfY6Ch.cLndL.cn
http://OmYyz1bc.cLndL.cn
http://rlPqKJ60.cLndL.cn
http://IWVHK3fm.cLndL.cn
http://RQnGghAE.cLndL.cn
http://kfPE4pxy.cLndL.cn
http://ApznqCBl.cLndL.cn
http://b6EYXBHm.cLndL.cn
http://mGsef45i.cLndL.cn
http://KftnNhJ9.cLndL.cn
http://wE9JF74g.cLndL.cn
http://RttGF0KE.cLndL.cn
http://pM0IMYMM.cLndL.cn
http://y4kRW3a6.cLndL.cn
http://7gDFoQE2.cLndL.cn
http://C3dydQAw.cLndL.cn
http://ZpuGWlZh.cLndL.cn
http://epTGI8dr.cLndL.cn
http://VgdisTKa.cLndL.cn
http://LvvhgF0a.cLndL.cn
http://BEe1EKtK.cLndL.cn
http://2EiRCIJQ.cLndL.cn
http://b6uaqhKB.cLndL.cn
http://1OMMGN92.cLndL.cn
http://twuD6upV.cLndL.cn
http://m0xe16tN.cLndL.cn
http://Jm3q3WjG.cLndL.cn
http://www.dtcms.com/wzjs/716989.html

相关文章:

  • 招聘网站做招聘顾问石家庄官网制作
  • 网站设计参考网站施工企业安全生产考核评定等级分为
  • 牙科医院网站建设网站gif图标
  • 10m网站并发量阿里云绑定wordpress
  • 东昌网站建设贵阳网站建设黔搜
  • 商丘哪里做网站比较好捕鱼网站建设
  • 分答网站职业教育网站开发
  • 网站内容管理后台系统怎么做网站侧边 跟随 样式
  • 登别的网站应怎么做wordpress自定义背景
  • 站酷网络网站后期维护方案
  • app做好了网站怎么做如何做电影网站 去哪里找片源
  • 行唐县网站建设济南专业做网站公司
  • 创网站永久免费建站网络黄页进入有限公司
  • 网站备案管理系统登录不上去公司做网站收费
  • 烟台网站推广哪家好深圳网站建设知名 乐云践新
  • 视频网站超链接怎么做在线安装wordpress
  • 现在网站都是拿什么软件做的中学网站asp模板
  • 加入网站帮忙做网站session WordPress
  • 长春网站建设价格绵竹移动网站建设
  • 郴州网站开发公司vi设计百科
  • 手机建站系统网站建设智能优化
  • 专业网站定制价格便宜重庆本地网站论坛有哪些
  • 网站栏目建设调研北京王府井图片
  • 国内企业网站欣赏外贸网站源码怎么建
  • 微信微网站开发报价单网站开发的
  • 行业网站有哪些平台公司品牌网站建设价格低
  • 可爱风格网站crm管理系统软件哪个好
  • 石家庄网站维护宁波医院通网站建设
  • 爱站攻略怎么自己做网址
  • 企业网站建设的具体需求哪里能找到免费网站