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

哪些专门做批发的网站百度平台订单查询

哪些专门做批发的网站,百度平台订单查询,成立公司的流程和要求及费用,如何在工信部网站注册使用python_cv实现目标实时检测 python 安装依赖核心代码快速使用实现结果展示enjoy python 安装依赖 opencv_python4.7.0.72 pandas1.5.3 tensorflow2.11.0 tensorflow_hub0.13.0 tensorflow_intel2.11.0 numpy1.23.5核心代码快速使用 # 使用了TensorFlow Hub和OpenCV库来实…

使用python_cv实现目标实时检测

  • python 安装依赖
  • 核心代码快速使用
  • 实现结果展示
  • enjoy

python 安装依赖

opencv_python==4.7.0.72
pandas==1.5.3
tensorflow==2.11.0
tensorflow_hub==0.13.0
tensorflow_intel==2.11.0
numpy==1.23.5

核心代码快速使用

# 使用了TensorFlow Hub和OpenCV库来实现实时对象检测
# tensorflow_hub:用于加载预训练的模型。
# cv2:OpenCV库,用于图像处理和视频流操作。
# tensorflow:深度学习框架。
# pandas:数据处理库。import tensorflow_hub as hub
import cv2
# import numpy
import tensorflow as tf
import pandas as pd# 加载了EfficientDet Lite2检测模型,并读取了标签文件:# 模型加载方式被注释掉,直接通过本地路径加载模型。
# 从CSV文件中读取标签,以ID作为索引,获取对象名称。# Carregar modelos
# detector = hub.load("https://tfhub.dev/tensorflow/efficientdet/lite2/detection/1")
detector = hub.load("efficientdet_lite2_detection_1")
labels = pd.read_csv('labels.csv', sep=';', index_col='ID')
labels = labels['OBJECT (2017 REL.)']# 初始化摄像头捕获,0表示默认摄像头。
cap = cv2.VideoCapture(0)# 定义输入图像的宽度和高度。width = 512
height = 512# 接下来是一个循环,用于实时处理视频流:
while (True):# Capture frame-by-frame# 在循环中,逐帧捕获视频并调整尺寸以匹配模型输入。ret, frame = cap.read()# Resize to respect the input_shapeinp = cv2.resize(frame, (width, height))# 将BGR格式的图像转换为RGB格式,这是因为大多数深度学习模型接受RGB输入。# Convert img to RGBrgb = cv2.cvtColor(inp, cv2.COLOR_BGR2RGB)# Is optional but i recommend (float convertion and convert img to tensor image)rgb_tensor = tf.convert_to_tensor(rgb, dtype=tf.uint8)# 将图像转换为TensorFlow张量,类型为uint8。# Add dims to rgb_tensorrgb_tensor = tf.expand_dims(rgb_tensor, 0)# 增加一个维度以匹配模型输入要求。boxes, scores, classes, num_detections = detector(rgb_tensor)pred_labels = classes.numpy().astype('int')[0]pred_labels = [labels[i] for i in pred_labels]pred_boxes = boxes.numpy()[0].astype('int')pred_scores = scores.numpy()[0]# 将预测结果转换为可处理的格式,包括标签、边界框和得分。#循环遍历每个检测到的对象,绘制边界框和标签,只显示得分高于0.5的对象。# loop throughout the faces detected and place a box around itfor score, (ymin, xmin, ymax, xmax), label in zip(pred_scores, pred_boxes, pred_labels):if score < 0.5:continuescore_txt = f'{100 * round(score,0)}'img_boxes = cv2.rectangle(rgb, (xmin, ymax), (xmax, ymin), (0,  255, 0), 1)font = cv2.FONT_HERSHEY_SIMPLEXcv2.putText(img_boxes, label, (xmin, ymax-10), font, 0.5, (255, 0, 0), 1, cv2.LINE_AA)cv2.putText(img_boxes, score_txt, (xmax, ymax-10), font, 0.5, (255, 0, 0), 1, cv2.LINE_AA)# 显示处理后的图像,并在按下'q'键时退出循环。# Display the resulting framecv2.imshow('black and white', img_boxes)if cv2.waitKey(1) & 0xFF == ord('q'):break# 释放摄像头资源并关闭所有OpenCV窗口,确保程序正常结束。
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

实现结果展示

enjoy

github:liveCamer

http://www.tj-hxxt.cn/news/113832.html

相关文章:

  • 网站的图文链接怎么做北京百度推广优化排名
  • 做徽标哪个网站素材多打开网站搜索
  • php网站开发流程百度客服电话24小时客服电话
  • 做网站非法吗指数基金投资指南
  • 企业培训网站建设免费seo教程
  • 莒县网站制作免费发布推广的平台
  • 个人网页注册seo服务外包报价
  • 电商网站建设需求分析书桂林网站优化
  • 南宁做网站 的图片优化软件
  • 网站内链如何布局网站的网络推广
  • 如何做网站外链seo搜索引擎优化课后答案
  • 手机网站建设市场报价我想接app纯注册推广单
  • 网络运营商自动选择seo引擎优化是做什么的
  • 做外贸网站平台有哪些内容线上拓客渠道有哪些
  • 南通网站建设报价碉堡了seo博客
  • 湖北做网站公司优化seo系统
  • 做网站首先要干什么市场营销策划
  • 上海人才网最新招聘信息官方网站深圳网络推广
  • 湖州设计公司seo智能优化系统
  • 有域名了 怎么做网站老域名
  • 政府网站建设管理会议google关键词优化排名
  • 网站seo搜索引擎优化教程网络运营是什么意思
  • 苏州高端网站设计在线网页制作网站
  • 电脑在哪网站接做扇子单网页设计与制作步骤
  • 网站开发的工具西安疫情最新数据
  • html5 网站布局应用教程电商培训机构排名
  • wordpress 获取域名排名sem优化软件
  • 响应式网站无法做百度联盟技能培训有哪些
  • 在线做文档的网站长沙推广公司
  • 织梦网站怎么做备份理发美发培训学校