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

ftp 网站 怎么上传文件自己的电脑做服务器 并建网站

ftp 网站 怎么上传文件,自己的电脑做服务器 并建网站,如何做公司网站空间,网站推广怎么样对象检测是一种计算机视觉技术#xff0c;它使软件系统能够从给定的图像或视频中检测、定位并跟踪物体。对象检测的一个特殊属性是它能识别对象的类别#xff08;如人、桌子、椅子等#xff09;并在给定图像中指出其具体位置坐标。这个位置通常通过在物体周围绘制一个边界框…对象检测是一种计算机视觉技术它使软件系统能够从给定的图像或视频中检测、定位并跟踪物体。对象检测的一个特殊属性是它能识别对象的类别如人、桌子、椅子等并在给定图像中指出其具体位置坐标。这个位置通常通过在物体周围绘制一个边界框来指出。边界框可能会也可能不会准确地定位物体的位置。在图像内定位物体的能力定义了用于检测的算法的性能。人脸检测就是对象检测的一个例子。 通常对象检测任务分为三个步骤 生成输入的小片段如下图所示。你可以看到大量的边界框覆盖了整个图像。对每个分割的矩形区域进行特征提取以预测矩形是否包含有效物体。将重叠的框合并成一个单一的边界矩形非极大值抑制。 TensorFlow是一个用于数值计算和大规模机器学习的开源库它简化了获取数据、训练模型、提供预测和完善未来结果的过程。TensorFlow集合了机器学习和深度学习模型与算法使用Python作为方便的前端并在优化的C中高效运行。 使用TensorFlow进行对象检测如上所述使用这个API不一定需要了解神经网络和机器学习的知识因为我们主要使用API中提供的文件。我们需要的只是一些Python知识和完成这个项目的热情。 按照以下步骤进行 第1步创建一个名为ObjectDetection的文件夹并用VS Code打开。 第2步通过在VS Code的终端输入以下命令从Github仓库下载Tensorflow API git clone https://github.com/tensorflow/models第3步设置虚拟环境 python -m venv --system-site-packages .\venv激活环境 .\venv\Scripts\activate将pip版本升级到最新 python -m pip install --upgrade --ignore-installed第4步安装依赖项 安装并升级tensorflow pip install tensorflow pip install --upgrade tensorflow安装matplotlib pip install pillow Cython lxml jupyter matplotlib导航到models文件夹中的research子文件夹。 cd \models\research\第5步现在我们需要下载Protocol BuffersProtobuf这是谷歌的一种语言中立、平台中立的扩展机制用于序列化结构化数据可以想象成XML但更小、更快、更简单。 在models文件夹的research子文件夹中提取从上述链接下载的zip的内容并访问bin文件夹复制那里的protoc.exe的路径。然后打开“编辑系统环境变量”并点击“环境变量”。 (i) 在系统变量下选择’path’并点击编辑。 (ii) 点击新建并粘贴’protoc.exe’的复制路径。 第6步然后在VS Code的终端运行这个命令 protoc object_detection/protos/*.proto --python_out.第7步在同一文件夹中创建一个名为detect.py的新Python文件并粘贴下面给出的代码 import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile import pathlib from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image from IPython.display import display from object_detection.utils import ops as utils_ops from object_detection.utils import label_map_util from object_detection.utils import visualization_utils as vis_util# 当前目录不是models时改变当前工作目录 while models in pathlib.Path.cwd().parts:os.chdir(..)# 加载模型函数 def load_model(model_name):base_url http://download.tensorflow.org/models/object_detection/model_file model_name .tar.gzmodel_dir tf.keras.utils.get_file(fnamemodel_name, originbase_url model_file,untarTrue)model_dir pathlib.Path(model_dir)/saved_modelmodel tf.saved_model.load(str(model_dir))return model# 路径到标签文件 PATH_TO_LABELS models/research/object_detection/data/mscoco_label_map.pbtxt # 创建类别索引 category_index label_map_util.create_category_index_from_labelmap(PATH_TO_LABELS, use_display_nameTrue)# 模型名称 model_name ssd_inception_v2_coco_2017_11_17 # 加载检测模型 detection_model load_model(model_name)# 为单个图像运行推理的函数 def run_inference_for_single_image(model, image):image np.asarray(image)# 输入需要是张量使用tf.convert_to_tensor进行转换。input_tensor tf.convert_to_tensor(image)# 模型期望图像的批量所以使用tf.newaxis添加一个轴。input_tensor input_tensor[tf.newaxis,...]# 运行推理model_fn model.signatures[serving_default]output_dict model_fn(input_tensor)# 所有输出都是批量张量。# 转换为numpy数组并取索引[0]来去除批量维度。# 我们只对前num_detections个检测感兴趣。num_detections int(output_dict.pop(num_detections))output_dict {key:value[0, :num_detections].numpy() for key,value in output_dict.items()}output_dict[num_detections] num_detections# detection_classes应该是整数。output_dict[detection_classes] output_dict[detection_classes].astype(np.int64)# 处理带有掩模的模型if detection_masks in output_dict:# 将边框掩模调整到图像大小。detection_masks_reframed utils_ops.reframe_box_masks_to_image_masks(output_dict[detection_masks], output_dict[detection_boxes],image.shape[0], image.shape[1]) detection_masks_reframed tf.cast(detection_masks_reframed 0.5,tf.uint8)output_dict[detection_masks_reframed] detection_masks_reframed.numpy()return output_dict# 展示推理的函数 def show_inference(model, frame):# 从摄像头获取画面并将其转换为数组image_np np.array(frame)# 实际检测。output_dict run_inference_for_single_image(model, image_np)# 对检测结果进行可视化。vis_util.visualize_boxes_and_labels_on_image_array(image_np,output_dict[detection_boxes],output_dict[detection_classes],output_dict[detection_scores],category_index,instance_masksoutput_dict.get(detection_masks_reframed, None),use_normalized_coordinatesTrue,line_thickness5)return(image_np)# 现在我们打开摄像头并开始检测物体 import cv2 video_capture cv2.VideoCapture(0) while True:# 逐帧捕获re,frame video_capture.read()Imagenpshow_inference(detection_model, frame)cv2.imshow(object detection, cv2.resize(Imagenp, (800,600)))if cv2.waitKey(1) amp; 0xFF ord(q):break video_capture.release() cv2.destroyAllWindows()第7步对于实时对象检测我们还需要一个额外的依赖库OpenCV。因此要安装OpenCV请在终端运行以下命令。 pip install opencv-python第8步现在我们已经准备就绪可以执行设置并进行对象检测了。执行’detect.py’文件。 python detect.py
http://www.zqtcl.cn/news/523008/

相关文章:

  • 自己做的网站怎么发布视频教程廊坊网站排名优化公司哪家好
  • 域名服务器都有了怎么做网站网站开发获取用户微信号登录
  • 淮南建设公司网站企业系统工程
  • 仓山福州网站建设佛山网站制作专业公司
  • 男男做的视频网站扬中网站建设案例
  • 做钓鱼网站用哪种编程语言代理网站备案
  • 广汉有没有做网站建设公司wordpress 301插件
  • 龙岗菠菜网站建设chatgpt网页
  • 如何查看网站ftp地址四川公共资源交易网招标网
  • 家居企业网站建设机构沈阳工程信息
  • 上海好的网站设计公司wordpress 上传文件路径
  • 用微信微博网站来做睡眠经济亚马逊跨境电商开店流程及费用
  • 网络公司做的网站根目录在哪网站建设必备条件
  • 网站建设外包服务管理情况公众号 链接wordpress
  • 深圳网站建设黄浦网络 技术差做网站的怎么跑业务
  • 青岛崂山区网站建设广东企业网站建设多少钱
  • 男女做那个的小视频网站韩国儿童才艺网站建设模板
  • 餐饮品牌网站建设淮北论坛最新招聘
  • 给客户做网站网站自动适应屏幕
  • 人力资源培训与开发什么是网站优化
  • 制作 网站 盈利农村自建房设计图一层平房
  • 佛山住房和城乡建设厅网站wordpress图片外链转内链
  • 海东高端网站建设价格wordpress侧边栏淘宝客
  • 网站功能建设中页面wordpress让投稿
  • 学校网站 asp网站结构方面主要做哪些优化
  • 深圳做网站(信科网络)做网站需要多少资金
  • 做网站实例教程网站图片的作用
  • 网站建设展板营销渠道的三个类型
  • 用php做视频网站有哪些十大免费logo设计
  • 网站建设对于网络营销的意义微信购物商城