Skip to content

Commit a5da393

Browse files
committed
add 300wlp
1 parent 3eb49e2 commit a5da393

File tree

8 files changed

+105
-153
lines changed

8 files changed

+105
-153
lines changed

configs/_base_/datasets/300w_LP.py

Lines changed: 0 additions & 134 deletions
This file was deleted.

configs/_base_/datasets/300wlp.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
dataset_info = dict(
2+
dataset_name='300wlp',
3+
paper_info=dict(
4+
author='Xiangyu Zhu1, and Zhen Lei1 '
5+
'and Xiaoming Liu2, and Hailin Shi1 '
6+
'and Stan Z. Li1',
7+
title='300 faces in-the-wild challenge: '
8+
'Database and results',
9+
container='Image and vision computing',
10+
year='2016',
11+
homepage='http://www.cbsr.ia.ac.cn/users/xiangyuzhu/'
12+
'projects/3DDFA/main.htm',
13+
),
14+
keypoint_info={
15+
0: dict(name='kpt-0', id=0, color=[255, 0, 0], type='', swap=''),
16+
1: dict(name='kpt-1', id=1, color=[255, 0, 0], type='', swap=''),
17+
2: dict(name='kpt-2', id=2, color=[255, 0, 0], type='', swap=''),
18+
3: dict(name='kpt-3', id=3, color=[255, 0, 0], type='', swap=''),
19+
4: dict(name='kpt-4', id=4, color=[255, 0, 0], type='', swap=''),
20+
5: dict(name='kpt-5', id=5, color=[255, 0, 0], type='', swap=''),
21+
6: dict(name='kpt-6', id=6, color=[255, 0, 0], type='', swap=''),
22+
7: dict(name='kpt-7', id=7, color=[255, 0, 0], type='', swap=''),
23+
8: dict(name='kpt-8', id=8, color=[255, 0, 0], type='', swap=''),
24+
9: dict(name='kpt-9', id=9, color=[255, 0, 0], type='', swap=''),
25+
10: dict(name='kpt-10', id=10, color=[255, 0, 0], type='', swap=''),
26+
11: dict(name='kpt-11', id=11, color=[255, 0, 0], type='', swap=''),
27+
12: dict(name='kpt-12', id=12, color=[255, 0, 0], type='', swap=''),
28+
13: dict(name='kpt-13', id=13, color=[255, 0, 0], type='', swap=''),
29+
14: dict(name='kpt-14', id=14, color=[255, 0, 0], type='', swap=''),
30+
15: dict(name='kpt-15', id=15, color=[255, 0, 0], type='', swap=''),
31+
16: dict(name='kpt-16', id=16, color=[255, 0, 0], type='', swap=''),
32+
17: dict(name='kpt-17', id=17, color=[255, 0, 0], type='', swap=''),
33+
18: dict(name='kpt-18', id=18, color=[255, 0, 0], type='', swap=''),
34+
19: dict(name='kpt-19', id=19, color=[255, 0, 0], type='', swap=''),
35+
20: dict(name='kpt-20', id=20, color=[255, 0, 0], type='', swap=''),
36+
21: dict(name='kpt-21', id=21, color=[255, 0, 0], type='', swap=''),
37+
22: dict(name='kpt-22', id=22, color=[255, 0, 0], type='', swap=''),
38+
23: dict(name='kpt-23', id=23, color=[255, 0, 0], type='', swap=''),
39+
24: dict(name='kpt-24', id=24, color=[255, 0, 0], type='', swap=''),
40+
25: dict(name='kpt-25', id=25, color=[255, 0, 0], type='', swap=''),
41+
26: dict(name='kpt-26', id=26, color=[255, 0, 0], type='', swap=''),
42+
27: dict(name='kpt-27', id=27, color=[255, 0, 0], type='', swap=''),
43+
28: dict(name='kpt-28', id=28, color=[255, 0, 0], type='', swap=''),
44+
29: dict(name='kpt-29', id=29, color=[255, 0, 0], type='', swap=''),
45+
30: dict(name='kpt-30', id=30, color=[255, 0, 0], type='', swap=''),
46+
31: dict(name='kpt-31', id=31, color=[255, 0, 0], type='', swap=''),
47+
32: dict(name='kpt-32', id=32, color=[255, 0, 0], type='', swap=''),
48+
33: dict(name='kpt-33', id=33, color=[255, 0, 0], type='', swap=''),
49+
34: dict(name='kpt-34', id=34, color=[255, 0, 0], type='', swap=''),
50+
35: dict(name='kpt-35', id=35, color=[255, 0, 0], type='', swap=''),
51+
36: dict(name='kpt-36', id=36, color=[255, 0, 0], type='', swap=''),
52+
37: dict(name='kpt-37', id=37, color=[255, 0, 0], type='', swap=''),
53+
38: dict(name='kpt-38', id=38, color=[255, 0, 0], type='', swap=''),
54+
39: dict(name='kpt-39', id=39, color=[255, 0, 0], type='', swap=''),
55+
40: dict(name='kpt-40', id=40, color=[255, 0, 0], type='', swap=''),
56+
41: dict(name='kpt-41', id=41, color=[255, 0, 0], type='', swap=''),
57+
42: dict(name='kpt-42', id=42, color=[255, 0, 0], type='', swap=''),
58+
43: dict(name='kpt-43', id=43, color=[255, 0, 0], type='', swap=''),
59+
44: dict(name='kpt-44', id=44, color=[255, 0, 0], type='', swap=''),
60+
45: dict(name='kpt-45', id=45, color=[255, 0, 0], type='', swap=''),
61+
46: dict(name='kpt-46', id=46, color=[255, 0, 0], type='', swap=''),
62+
47: dict(name='kpt-47', id=47, color=[255, 0, 0], type='', swap=''),
63+
48: dict(name='kpt-48', id=48, color=[255, 0, 0], type='', swap=''),
64+
49: dict(name='kpt-49', id=49, color=[255, 0, 0], type='', swap=''),
65+
50: dict(name='kpt-50', id=50, color=[255, 0, 0], type='', swap=''),
66+
51: dict(name='kpt-51', id=51, color=[255, 0, 0], type='', swap=''),
67+
52: dict(name='kpt-52', id=52, color=[255, 0, 0], type='', swap=''),
68+
53: dict(name='kpt-53', id=53, color=[255, 0, 0], type='', swap=''),
69+
54: dict(name='kpt-54', id=54, color=[255, 0, 0], type='', swap=''),
70+
55: dict(name='kpt-55', id=55, color=[255, 0, 0], type='', swap=''),
71+
56: dict(name='kpt-56', id=56, color=[255, 0, 0], type='', swap=''),
72+
57: dict(name='kpt-57', id=57, color=[255, 0, 0], type='', swap=''),
73+
58: dict(name='kpt-58', id=58, color=[255, 0, 0], type='', swap=''),
74+
59: dict(name='kpt-59', id=59, color=[255, 0, 0], type='', swap=''),
75+
60: dict(name='kpt-60', id=60, color=[255, 0, 0], type='', swap=''),
76+
61: dict(name='kpt-61', id=61, color=[255, 0, 0], type='', swap=''),
77+
62: dict(name='kpt-62', id=62, color=[255, 0, 0], type='', swap=''),
78+
63: dict(name='kpt-63', id=63, color=[255, 0, 0], type='', swap=''),
79+
64: dict(name='kpt-64', id=64, color=[255, 0, 0], type='', swap=''),
80+
65: dict(name='kpt-65', id=65, color=[255, 0, 0], type='', swap=''),
81+
66: dict(name='kpt-66', id=66, color=[255, 0, 0], type='', swap=''),
82+
67: dict(name='kpt-67', id=67, color=[255, 0, 0], type='', swap=''),
83+
},
84+
skeleton_info={},
85+
joint_weights=[1.] * 68,
86+
sigmas=[])

configs/face_2d_keypoint/topdown_heatmap/300wlp/hrnetv2_300wlp.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<details>
2222
<summary align="right"><a href="http://www.cbsr.ia.ac.cn/users/xiangyuzhu/projects/3DDFA/main.htm">300WLP (IEEE'2017)</a></summary>
2323

24-
2524
```bibtex
2625
@article{zhu2017face,
2726
title={Face alignment in full pose range: A 3d total solution},
@@ -38,7 +37,6 @@ Results on 300W-LP dataset
3837

3938
The model is trained on 300W-LP train.
4039

41-
| Arch | Input Size | NME<sub>*full*</sub> | NME<sub>*test*</sub> | ckpt | log |
42-
| :----------------------------------------------------------- | :--------: | :------------------: | :------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
40+
| Arch | Input Size | NME<sub>*full*</sub> | NME<sub>*test*</sub> | ckpt | log |
41+
| :------------------------------------------------- | :--------: | :------------------: | :------------------: | :------------------------------------------------: | :------------------------------------------------: |
4342
| [pose_hrnetv2_w18](/configs/face_2d_keypoint/topdown_heatmap/300wlp/td-hm_hrnetv2-w18_8xb64-60e_300wlp-256x256.py) | 256x256 | 0.0413 | 0.04125 | [ckpt](https://download.openmmlab.com/mmpose/v1/face_2d_keypoint/topdown_heatmap/300wlp/hrnetv2_w18_300wlp_256x256-fb433d21_20230922.pth) | [log](https://download.openmmlab.com/mmpose/v1/face_2d_keypoint/topdown_heatmap/300wlp/hrnetv2_w18_300wlp_256x256-fb433d21_20230922.json) |
44-

mmpose/datasets/datasets/face/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
from .coco_wholebody_face_dataset import CocoWholeBodyFaceDataset
44
from .cofw_dataset import COFWDataset
55
from .face_300w_dataset import Face300WDataset
6+
from .face_300wlp_dataset import Face300WLPDataset
67
from .lapa_dataset import LapaDataset
78
from .wflw_dataset import WFLWDataset
8-
from .face_300wlp_dataset import Face300WLPDataset
9+
910
__all__ = [
1011
'Face300WDataset', 'WFLWDataset', 'AFLWDataset', 'COFWDataset',
1112
'CocoWholeBodyFaceDataset', 'LapaDataset', 'Face300WLPDataset'

mmpose/datasets/datasets/face/face_300wlp_dataset.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
2-
import os.path as osp
3-
from typing import Optional
4-
5-
import numpy as np
62

73
from mmpose.registry import DATASETS
8-
from mmpose.structures.bbox import bbox_cs2xyxy
94
from ..base import BaseCocoStyleDataset
105

116

@@ -57,5 +52,4 @@ class Face300WLPDataset(BaseCocoStyleDataset):
5752
image. Default: 1000.
5853
"""
5954

60-
METAINFO: dict = dict(from_file='configs/_base_/datasets/300w_LP.py')
61-
55+
METAINFO: dict = dict(from_file='configs/_base_/datasets/300wlp.py')

projects/just_dance/configs/_base_

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../configs/_base_
1+
../../../configs/_base_

tests/test_datasets/test_datasets/test_face_datasets/test_face_300wlp_dataset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22
from unittest import TestCase
3+
34
import numpy as np
45

56
from mmpose.datasets.datasets.face import Face300WLPDataset
@@ -136,5 +137,3 @@ def test_exceptions_and_warnings(self):
136137
data_mode='bottomup',
137138
test_mode=True,
138139
filter_cfg=dict(bbox_score_thr=0.3))
139-
140-

tools/dataset_converters/300wlp2coco.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import json
23
import os
34
import os.path as osp
@@ -27,8 +28,13 @@ def move_img(img_path, save_img):
2728

2829

2930
# split 300w-lp data
30-
def split_data(file_img, train_path, val_path,
31-
test_path, shuffle=True, ratio1=0.8, ratio2=0.1):
31+
def split_data(file_img,
32+
train_path,
33+
val_path,
34+
test_path,
35+
shuffle=True,
36+
ratio1=0.8,
37+
ratio2=0.1):
3238
img_list = os.listdir(file_img)
3339
if shuffle:
3440
np.random.shuffle(img_list)
@@ -140,7 +146,7 @@ def convert_300WLP_to_coco(root_path, img_pathDir, out_file):
140146
print(f'done {out_file}')
141147

142148

143-
if __name__ == "__main__":
149+
if __name__ == '__main__':
144150
# 1.Move all images to one folder
145151
# 2.split 300W-LP data
146152
# 3.convert json
@@ -160,4 +166,6 @@ def convert_300WLP_to_coco(root_path, img_pathDir, out_file):
160166
os.makedirs(anno_path_json)
161167
for tv in ['val', 'test', 'train']:
162168
print(f'processing {tv}')
163-
convert_300WLP_to_coco(root_path, tv, anno_path_json + '/' + f'face_landmarks_300wlp_{tv}.json')
169+
convert_300WLP_to_coco(
170+
root_path, tv,
171+
anno_path_json + '/' + f'face_landmarks_300wlp_{tv}.json')

0 commit comments

Comments
 (0)