-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (21 loc) · 932 Bytes
/
Copy pathtest.py
File metadata and controls
27 lines (21 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from mmpose.apis import MMPoseInferencer
import os
people_list = [fold.split("_")[1] for fold in os.listdir('download/mmpose/work_dirs/rtmpose-l_8xb256-420e_coco-256x192')]
img_path = 'dataset'
for person in people_list:
file_list = os.listdir(f'download/mmpose/work_dirs/rtmpose-l_8xb256-420e_coco-256x192/EPE_{person}')
for files in file_list:
if "best_EPE_epoch" in files:
file = files
break
inferencer = MMPoseInferencer(
pose2d_weights=f'download/mmpose/work_dirs/rtmpose-l_8xb256-420e_coco-256x192/EPE_{person}/{file}',
det_model='rtmpose-l_8xb256-420e_coco-256x192',
det_cat_ids=[0]
)
List = os.listdir(img_path)
os.makedirs(f"{person}")
for jpg in List:
if person in jpg:
result_generator = inferencer(img_path + f'/{jpg}', show=False, vis_out_dir= f"{person}")
result = next(result_generator)