Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support yolox pose refer from mmpose #694

Merged
merged 103 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 98 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c6aaa3e
add
Nioolek Mar 5, 2023
72fbdc8
reproduce map
Nioolek Mar 6, 2023
36d4ef9
add typehint and doc
Nioolek Mar 6, 2023
ea925f5
format code
Nioolek Mar 7, 2023
97d6c74
replace key
Nioolek Mar 7, 2023
b6b5441
add ut
Nioolek Mar 7, 2023
3ab1558
format
Nioolek Mar 7, 2023
3769e4f
format
Nioolek Mar 7, 2023
ff4d67b
format code
Nioolek Mar 8, 2023
7e37055
fix ut
Nioolek Mar 8, 2023
915b59f
fix ut
Nioolek Mar 9, 2023
5079e89
fix comment
Nioolek Mar 9, 2023
5f65ee5
fix comment
Nioolek Mar 9, 2023
898b3db
fix comment
Nioolek Mar 9, 2023
af28a73
[WIP][Feature] Support yolov5-Ins training
JosonChan1998 Mar 10, 2023
e4cc2e3
fix comment
Nioolek Mar 10, 2023
3ca251b
change data flow and fix loss_mask compute
JosonChan1998 Mar 10, 2023
c0d1468
Merge pull request #636 from Nioolek/v8_seg_inference
Nioolek Mar 11, 2023
f17431a
merge ins_seg_dev branch
JosonChan1998 Mar 11, 2023
efd7733
align the data pipeline
JosonChan1998 Mar 11, 2023
db07a2c
remove albu gt mask key
JosonChan1998 Mar 11, 2023
a6c2b14
support yolov5 ins inference
JosonChan1998 Mar 14, 2023
427a1b7
fix multi gpu test
JosonChan1998 Mar 14, 2023
482b6b4
align the post_process with v8
JosonChan1998 Mar 14, 2023
67636bc
support training
JosonChan1998 Mar 15, 2023
86a7008
support training
JosonChan1998 Mar 15, 2023
e53454d
code formatting
JosonChan1998 Mar 16, 2023
10cc84c
code formatting
JosonChan1998 Mar 17, 2023
e32cdd9
Support pad_param type (#672)
Nioolek Mar 17, 2023
f3ff2b6
Merge latest ins_seg_dev branch
JosonChan1998 Mar 17, 2023
920b185
add half_pad_param
JosonChan1998 Mar 17, 2023
c1b357a
fix default fast_test
JosonChan1998 Mar 17, 2023
4202b8e
fix loss weight compute
JosonChan1998 Mar 22, 2023
9c502ee
add models
yechenzhi Mar 25, 2023
8dc1f6c
add dataset1
yechenzhi Mar 25, 2023
573e96e
add dataset2
yechenzhi Mar 25, 2023
53a74b6
add dataset3
yechenzhi Mar 25, 2023
40fd614
add configs
yechenzhi Mar 25, 2023
9f7d983
re commit __init__
yechenzhi Mar 25, 2023
3c7e033
re commit __init__
yechenzhi Mar 25, 2023
7441cb9
re commit
yechenzhi Mar 25, 2023
761d984
del local
yechenzhi Mar 25, 2023
b3703b4
add typo
yechenzhi Mar 26, 2023
242764f
del PoseToDetConverter and BBoxKeypoints
yechenzhi Mar 30, 2023
52e68e5
del local changes
yechenzhi Mar 30, 2023
cc7f05f
fix mask rescale, add segment merge, fix segment2bbox
JosonChan1998 Apr 4, 2023
026662f
fix pipeline
yechenzhi Apr 5, 2023
bab5e17
add dataset
yechenzhi Apr 5, 2023
0247f16
fix typo
yechenzhi Apr 5, 2023
862f11c
add resize in mmyolo
yechenzhi Apr 5, 2023
16cdf37
fix typo
yechenzhi Apr 5, 2023
109928e
del local
yechenzhi Apr 5, 2023
312e39d
del local changes
yechenzhi Apr 5, 2023
f07736c
del local changes
yechenzhi Apr 5, 2023
3a803cc
fix dir name
yechenzhi Apr 5, 2023
bcd4e01
fix dir name
yechenzhi Apr 5, 2023
293a98c
add FilterAnnotations
yechenzhi Apr 6, 2023
69f86c8
fix typo
yechenzhi Apr 7, 2023
501ab35
new config for yolox-pose
yechenzhi Apr 7, 2023
93fd0a4
fix typo
yechenzhi Apr 7, 2023
151a807
fix typo
yechenzhi Apr 7, 2023
1dcb360
fix clip and fix mask init
JosonChan1998 Apr 8, 2023
66968e0
del pose dataset changes
yechenzhi Apr 9, 2023
9e81ed7
fix YOLOv5DetDataPreprocessor
yechenzhi Apr 14, 2023
f459667
del local file
yechenzhi Apr 14, 2023
32d6705
fix typo
yechenzhi Apr 15, 2023
3bd9c0b
del init_cfg
yechenzhi Apr 16, 2023
548c016
simplify config
yechenzhi Apr 17, 2023
a5693aa
fix batch size
yechenzhi Apr 17, 2023
59428ed
fix batch size
yechenzhi Apr 17, 2023
5b1a9ed
fix typo
yechenzhi Apr 17, 2023
4de416b
Merge branch 'dev' of https://github.com/open-mmlab/mmyolo into dev
JosonChan1998 Apr 18, 2023
0f99cce
code formatting
JosonChan1998 Apr 18, 2023
42b6240
code formatting
JosonChan1998 Apr 18, 2023
10e4cd7
code formatting
JosonChan1998 Apr 18, 2023
8630848
code formatting
JosonChan1998 Apr 18, 2023
2ae8768
fix bug for FilterAnnotations
yechenzhi Apr 20, 2023
2985560
simpler way for FilterAnnotations
yechenzhi Apr 20, 2023
5d86f28
Merge branch 'dev' of https://github.com/open-mmlab/mmyolo into ins
JosonChan1998 Apr 21, 2023
bdbc015
update config
hhaAndroid Apr 21, 2023
70a2aa9
[Fix] fix load image from file
JosonChan1998 Apr 21, 2023
72700ef
shorten eval time
yechenzhi Apr 22, 2023
18dafeb
fix typo
yechenzhi Apr 22, 2023
3df55b8
add large model
yechenzhi Apr 23, 2023
48cdfd3
[Add] Add docs and more config
JosonChan1998 Apr 23, 2023
410f1eb
[Fix] config type and test_formatting
JosonChan1998 Apr 24, 2023
242ed40
[Fix] fix yolov5-ins_m packdetinputs
JosonChan1998 Apr 24, 2023
a5b5ea7
hand rebase from yolov5-ins
yechenzhi Apr 25, 2023
ccf92ee
use new PackDetInputs
yechenzhi Apr 25, 2023
4f18cd2
rebase
yechenzhi Apr 25, 2023
e699ebe
rebase fix typo
yechenzhi Apr 25, 2023
242152e
add mapping table
yechenzhi Apr 25, 2023
2514fc5
fix typo
yechenzhi Apr 25, 2023
2bd7c45
add weight
yechenzhi Apr 25, 2023
3bd4edd
rebase
yechenzhi Apr 27, 2023
45571d9
del typo
yechenzhi Apr 27, 2023
0f4aa95
del typo
yechenzhi Apr 27, 2023
509becd
add results
hhaAndroid May 4, 2023
0687fe4
install mmpose, Keypoints note, context manager, predict, ota rename
yechenzhi May 6, 2023
9f3d5a0
fix test
yechenzhi May 7, 2023
01a75fb
add unittest for pose_sim_ota_assigner and yolox_head
yechenzhi May 13, 2023
70b94f4
add unittest for pose_sim_ota_assigner and yolox_head
yechenzhi May 13, 2023
fa802e7
fix typo
yechenzhi May 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dev_scripts/gather_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def get_dataset_name(config):
name_map = dict(
CityscapesDataset='Cityscapes',
CocoDataset='COCO',
PoseCocoDataset='COCO Person',
YOLOv5CocoDataset='COCO',
CocoPanopticDataset='COCO',
YOLOv5DOTADataset='DOTA 1.0',
Expand Down
181 changes: 181 additions & 0 deletions configs/_base_/pose/coco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
dataset_info = dict(
dataset_name='coco',
paper_info=dict(
author='Lin, Tsung-Yi and Maire, Michael and '
'Belongie, Serge and Hays, James and '
'Perona, Pietro and Ramanan, Deva and '
r'Doll{\'a}r, Piotr and Zitnick, C Lawrence',
title='Microsoft coco: Common objects in context',
container='European conference on computer vision',
year='2014',
homepage='http://cocodataset.org/',
),
keypoint_info={
0:
dict(name='nose', id=0, color=[51, 153, 255], type='upper', swap=''),
1:
dict(
name='left_eye',
id=1,
color=[51, 153, 255],
type='upper',
swap='right_eye'),
2:
dict(
name='right_eye',
id=2,
color=[51, 153, 255],
type='upper',
swap='left_eye'),
3:
dict(
name='left_ear',
id=3,
color=[51, 153, 255],
type='upper',
swap='right_ear'),
4:
dict(
name='right_ear',
id=4,
color=[51, 153, 255],
type='upper',
swap='left_ear'),
5:
dict(
name='left_shoulder',
id=5,
color=[0, 255, 0],
type='upper',
swap='right_shoulder'),
6:
dict(
name='right_shoulder',
id=6,
color=[255, 128, 0],
type='upper',
swap='left_shoulder'),
7:
dict(
name='left_elbow',
id=7,
color=[0, 255, 0],
type='upper',
swap='right_elbow'),
8:
dict(
name='right_elbow',
id=8,
color=[255, 128, 0],
type='upper',
swap='left_elbow'),
9:
dict(
name='left_wrist',
id=9,
color=[0, 255, 0],
type='upper',
swap='right_wrist'),
10:
dict(
name='right_wrist',
id=10,
color=[255, 128, 0],
type='upper',
swap='left_wrist'),
11:
dict(
name='left_hip',
id=11,
color=[0, 255, 0],
type='lower',
swap='right_hip'),
12:
dict(
name='right_hip',
id=12,
color=[255, 128, 0],
type='lower',
swap='left_hip'),
13:
dict(
name='left_knee',
id=13,
color=[0, 255, 0],
type='lower',
swap='right_knee'),
14:
dict(
name='right_knee',
id=14,
color=[255, 128, 0],
type='lower',
swap='left_knee'),
15:
dict(
name='left_ankle',
id=15,
color=[0, 255, 0],
type='lower',
swap='right_ankle'),
16:
dict(
name='right_ankle',
id=16,
color=[255, 128, 0],
type='lower',
swap='left_ankle')
},
skeleton_info={
0:
dict(link=('left_ankle', 'left_knee'), id=0, color=[0, 255, 0]),
1:
dict(link=('left_knee', 'left_hip'), id=1, color=[0, 255, 0]),
2:
dict(link=('right_ankle', 'right_knee'), id=2, color=[255, 128, 0]),
3:
dict(link=('right_knee', 'right_hip'), id=3, color=[255, 128, 0]),
4:
dict(link=('left_hip', 'right_hip'), id=4, color=[51, 153, 255]),
5:
dict(link=('left_shoulder', 'left_hip'), id=5, color=[51, 153, 255]),
6:
dict(link=('right_shoulder', 'right_hip'), id=6, color=[51, 153, 255]),
7:
dict(
link=('left_shoulder', 'right_shoulder'),
id=7,
color=[51, 153, 255]),
8:
dict(link=('left_shoulder', 'left_elbow'), id=8, color=[0, 255, 0]),
9:
dict(
link=('right_shoulder', 'right_elbow'), id=9, color=[255, 128, 0]),
10:
dict(link=('left_elbow', 'left_wrist'), id=10, color=[0, 255, 0]),
11:
dict(link=('right_elbow', 'right_wrist'), id=11, color=[255, 128, 0]),
12:
dict(link=('left_eye', 'right_eye'), id=12, color=[51, 153, 255]),
13:
dict(link=('nose', 'left_eye'), id=13, color=[51, 153, 255]),
14:
dict(link=('nose', 'right_eye'), id=14, color=[51, 153, 255]),
15:
dict(link=('left_eye', 'left_ear'), id=15, color=[51, 153, 255]),
16:
dict(link=('right_eye', 'right_ear'), id=16, color=[51, 153, 255]),
17:
dict(link=('left_ear', 'left_shoulder'), id=17, color=[51, 153, 255]),
18:
dict(
link=('right_ear', 'right_shoulder'), id=18, color=[51, 153, 255])
},
joint_weights=[
1., 1., 1., 1., 1., 1., 1., 1.2, 1.2, 1.5, 1.5, 1., 1., 1.2, 1.2, 1.5,
1.5
],
sigmas=[
0.026, 0.025, 0.025, 0.035, 0.035, 0.079, 0.079, 0.072, 0.072, 0.062,
0.062, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089
])
26 changes: 26 additions & 0 deletions configs/yolox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@ The modified training parameters are as follows:
1. The test score threshold is 0.001.
2. Due to the need for pre-training weights, we cannot reproduce the performance of the `yolox-nano` model. Please refer to https://github.com/Megvii-BaseDetection/YOLOX/issues/674 for more information.

## YOLOX-Pose

Based on [MMPose](https://github.com/open-mmlab/mmpose/blob/main/projects/yolox-pose/README.md), we have implemented a YOLOX-based human pose estimator, utilizing the approach outlined in **YOLO-Pose: Enhancing YOLO for Multi Person Pose Estimation Using Object Keypoint Similarity Loss (CVPRW 2022)**. This pose estimator is lightweight and quick, making it well-suited for crowded scenes.

<div align=center>
<img src="https://user-images.githubusercontent.com/26127467/226655503-3cee746e-6e42-40be-82ae-6e7cae2a4c7e.jpg"/>
</div>

### Results

| Backbone | Size | Batch Size | AMP | RTMDet-Hyp | Mem (GB) | AP | Config | Download |
|:----------:|:----:|:----------:|:---:|:----------:|:--------:|:----:|:--------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| YOLOX-tiny | 416 | 8xb32 | Yes | Yes | 5.3 | 52.8 | [config](./pose/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco_20230427_080351-2117af67.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco_20230427_080351.log.json) |
| YOLOX-s | 640 | 8xb32 | Yes | Yes | 10.7 | 63.7 | [config](./pose/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco_20230427_005150-e87d843a.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco_20230427_005150.log.json) |
| YOLOX-m | 640 | 8xb32 | Yes | Yes | 19.2 | 69.3 | [config](./pose/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco_20230427_094024-bbeacc1c.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco_20230427_094024.log.json) |
| YOLOX-l | 640 | 8xb32 | Yes | Yes | 30.3 | 71.1 | [config](./pose/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco_20230427_041140-82d65ac8.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco_20230427_041140.log.json) |

**Note**

1. The performance is unstable and may fluctuate and the highest performance weight in `COCO` training may not be the last epoch. The performance shown above is the best model.


### Installation
hhaAndroid marked this conversation as resolved.
Show resolved Hide resolved



## Citation

```latex
Expand Down
48 changes: 48 additions & 0 deletions configs/yolox/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,51 @@ Models:
Metrics:
box AP: 47.5
Weights: https://download.openmmlab.com/mmyolo/v0/yolox/yolox_m_fast_8xb32-300e-rtmdet-hyp_coco/yolox_m_fast_8xb32-300e-rtmdet-hyp_coco_20230210_144328-e657e182.pth
- Name: yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco
In Collection: YOLOX
Config: yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco.py
Metadata:
Training Memory (GB): 5.3
Epochs: 300
Results:
- Task: Human Pose Estimation
Dataset: COCO
Metrics:
AP: 52.8
Weights: https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco/yolox-pose_tiny_8xb32-300e-rtmdet-hyp_coco_20230427_080351-2117af67.pth
- Name: yolox-pose_s_8xb32-300e-rtmdet-hyp_coco
In Collection: YOLOX
Config: yolox-pose_s_8xb32-300e-rtmdet-hyp_coco.py
Metadata:
Training Memory (GB): 10.7
Epochs: 300
Results:
- Task: Human Pose Estimation
Dataset: COCO
Metrics:
AP: 63.7
Weights: https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco/yolox-pose_s_8xb32-300e-rtmdet-hyp_coco_20230427_005150-e87d843a.pth
- Name: yolox-pose_m_8xb32-300e-rtmdet-hyp_coco
In Collection: YOLOX
Config: yolox-pose_m_8xb32-300e-rtmdet-hyp_coco.py
Metadata:
Training Memory (GB): 19.2
Epochs: 300
Results:
- Task: Human Pose Estimation
Dataset: COCO
Metrics:
AP: 69.3
Weights: https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco_20230427_094024-bbeacc1c.pth
- Name: yolox-pose_l_8xb32-300e-rtmdet-hyp_coco
In Collection: YOLOX
Config: yolox-pose_l_8xb32-300e-rtmdet-hyp_coco.py
Metadata:
Training Memory (GB): 30.3
Epochs: 300
Results:
- Task: Human Pose Estimation
Dataset: COCO
Metrics:
AP: 71.1
Weights: https://download.openmmlab.com/mmyolo/v0/yolox/pose/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco_20230427_041140-82d65ac8.pth
14 changes: 14 additions & 0 deletions configs/yolox/pose/yolox-pose_l_8xb32-300e-rtmdet-hyp_coco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_base_ = ['./yolox-pose_m_8xb32-300e-rtmdet-hyp_coco.py']

load_from = 'https://download.openmmlab.com/mmyolo/v0/yolox/yolox_l_fast_8xb8-300e_coco/yolox_l_fast_8xb8-300e_coco_20230213_160715-c731eb1c.pth' # noqa

# ========================modified parameters======================
deepen_factor = 1.0
widen_factor = 1.0

# =======================Unmodified in most cases==================
# model settings
model = dict(
backbone=dict(deepen_factor=deepen_factor, widen_factor=widen_factor),
neck=dict(deepen_factor=deepen_factor, widen_factor=widen_factor),
bbox_head=dict(head_module=dict(widen_factor=widen_factor)))
14 changes: 14 additions & 0 deletions configs/yolox/pose/yolox-pose_m_8xb32-300e-rtmdet-hyp_coco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_base_ = ['./yolox-pose_s_8xb32-300e-rtmdet-hyp_coco.py']

load_from = 'https://download.openmmlab.com/mmyolo/v0/yolox/yolox_m_fast_8xb32-300e-rtmdet-hyp_coco/yolox_m_fast_8xb32-300e-rtmdet-hyp_coco_20230210_144328-e657e182.pth' # noqa

# ========================modified parameters======================
deepen_factor = 0.67
widen_factor = 0.75

# =======================Unmodified in most cases==================
# model settings
model = dict(
backbone=dict(deepen_factor=deepen_factor, widen_factor=widen_factor),
neck=dict(deepen_factor=deepen_factor, widen_factor=widen_factor),
bbox_head=dict(head_module=dict(widen_factor=widen_factor)))
Loading