MMPose关键点检测实战

安装教程

https://github.com/TommyZihao/MMPose_Tutorials/blob/main/2023/0524/%E3%80%90A1%E3%80%91%E5%AE%89%E8%A3%85MMPose.ipynb

git clone https://github.com/open-mmlab/mmpose.git -b tutorial2023
-b代表切换到某个分支,保证分支和作者的教程一致

  1. raise ReadTimeoutError(self._pool, None, “Read timed out.”)
    pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
    mim resources not found: /home/zhou/Videos/mmd_dap-main/mmdet/.mim, you can try to install the latest mmdet.
    超时了

给命令设置超时连接时间 mim install “mmdet>=3.0.0rc6” --default-timeout=6000

三角板关键点检测实战

此链接中有数据集下载教程https://github.com/TommyZihao/MMPose_Tutorials/tree/main,三角尺数据集和存放目录如下:

共215张三角板的图片

MMPose关键点检测实战_第1张图片

categories里面有框的类别、点的信息、点的连接的信息

配置文件faster_r_cnn_triangle.py会有数据集和路径信息

# 数据集类型及路径
dataset_type = 'CocoDataset'
data_root = 'data/Triangle_215_Keypoint_coco/'
metainfo = {'classes': ('sjb_rect',)}
NUM_CLASSES = len(metainfo['classes'])

# 预训练模型权重
load_from = 'https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'

训练自己的数据集,需要改上面的前三行就行

训练faster r-cnn检测三角尺时:
allow_unreachable=True, accumulate_grad=True)  # allow_unreachable flag
RuntimeError: CUDA out of memory. Tried to allocate 200.00 MiB (GPU 0; 7.77 GiB total capacity; 4.53 GiB already allocated; 124.75 MiB free; 5.02 GiB reserved in total by PyTorch)

超显存了,调小batch_size 或者调小图片的尺寸

RTMPose精度非常高,比YOLOV8还高,但速度慢。

标注文件都是MSCOCO格式,work_directory目录保存
AP 、NME、AUC指标比较重要

F3代码可以可视化训练日志

MMPose关键点检测实战_第2张图片
问题:热力图上的点等间距分布

你可能感兴趣的:(pytorch,pytorch)