利用图像识别电视尺寸的模型

dlg-home-content的Python项目详细描述


dlg家庭内容

设置环境

  • conda env create -f environment.yml

  • 从源安装detectron2

  • cpu版本

> conda install pytorch torchvision cpuonly -c pytorch
> python -m pip install detectron2 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.6/index.html
> update environment `conda env update --file environment.yml`
  • 对于其他gpu版本,请使用this

可用的CLI命令

  • 转换labelme2co
^{pr2}$
  • 使用自定义数据集训练

我们需要定义三个配置文件

  • detectron上可用的基本cfg文件名。查看detectron/configs以获取示例。在
  • 包含修改参数的cfg文件。查看configs文件夹中的特定示例
  • 具有数据集和关键点相关参数的data_cfg。例如assets/datasets.yml
# normal instance segmentation
custom_train --base_cfg 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' --cfg 'configs/mask_only_exp1.yml' --data_cfg "assets/datasets.yml"# instance segmentation with keypoints
custom_train --base_cfg 'COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml' --cfg 'configs/keypoint_mask_on_exp1.yml' --data_cfg "assets/datasets.yml"

推论

徽标检测

here下载最新的推理文件

fromdlg_home_content.tv_detectionimportInferLogoconfig='../assets/e2e_infer.ymlmodel=InferLogo(config)model.predict(img_loc,visualize=True)

关键点检测推断

从[此处](https://fractalanalytic-my.sharepoint.com/:u:/g/personal/sindhura_k_fractal_ai/EXCaFSHWv3hMo99lvfP4zKIBLBO8dlnWzY7iUAFWYiXHKA?e=23XheZ)下载权重文件和配置文件

#for inner keyoint detection
from dlg_home_content.inference_pipeline import KeypointInference

config='../assets/e2e_infer.yml'#kp_type in ['kp_inner_edge','kp_outer_edge','kp_sticky_note']model_inner= KeypointInference(config, kp_type='kp_inner_edge')predicted_keyoints= model_inner.predict_keypoints(img_loc, visualize=True)

端到端推理管道

fromdlg_home_content.e2e_inferenceimportE2EInferenceconfig='../assets/e2e_infer.yml'final_pipeline=E2EInference(config)result=final_pipeline.infer(img_loc,8,8,True)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如果在使用JDBC时不包含db驱动程序会发生什么?   发生错误时使用JAXWS跟踪XML请求/响应   java servlet版本getServletContext()。getEffectiveMajorVersion()在我使用3时给了我2.5   jakarta mail在Java中使用Javamail获取消息contenttype时出错   java正在获取WebSphere app Server的实例名称   java在javafx中向TreeItem添加了一个addEventHandler   java我们可以在运行时从泛型类型实例化一个对象吗?   带倒计时的java循环[自动重新启动]   java将画布转换为位图   java在tomcat7上运行shell脚本   使用列表更新java hibernate实体   java如何替换� 字符串中带有“,”的字符?   使用SwingGUI的java简单ClientServer程序   java使用smtp在javamail中以附件形式发送超链接   selenium中的java用户登录身份验证?