이 저장소에는 CPU : Lightweight Openpose에 대한 논문 실시간 2D 다중 개인 포즈 추정에 대한 교육 코드가 포함되어 있습니다. 이 작업은 무시할 수없는 정확도 강하로 CPU에서 실시간 추론에 도달하기 위해 오픈페시 접근법을 크게 최적화합니다. 이미지 내부의 모든 사람에 대한 인간 포즈를 식별하기 위해 골격 (키패 인과 연결로 구성)을 감지합니다. 포즈에는 귀, 눈, 코, 목, 어깨, 팔꿈치, 손목, 엉덩이, 무릎 및 발목 등 최대 18 개의 키포인트가 포함될 수 있습니다. Coco 2017에서 키패 포인트 감지 검증 설정 세트이 코드는 단일 스케일 추론에 대해 40% AP를 달성합니다 (플립 또는 후 처리되지 않음). 이 저장소를 사용하여 결과를 재현 할 수 있습니다. 이 repo는 https://github.com/opencv/openvino_training_extensions와 크게 겹치지 만 인간 포즈 추정에 필요한 코드 만 포함됩니다.

CVPR'19 룩-개인 도전에서 10 위를 차지한 정확한 (그리고 여전히 빠른) 단인 포즈 추정에 대한 새로운 작품을 확인하십시오.
단일 샷 Multi-Person 3D 포즈 추정을 기반으로 한 경량 3D 포즈 추정을 확인하십시오.
<COCO_HOME> 폴더로 포장을 풀어주십시오.pip install -r requirements.txt 교육은 3 단계로 구성됩니다 (전체 유효성 검사 데이터 세트에 대한 AP 값이 주어짐) :
미리 훈련 된 Mobilenet v1 weights mobilenet_sgd_68.848.pth.tar from : https://github.com/marvis/pytorch-mobilenet (SGD 옵션). 이것이 작동하지 않으면 Googledrive에서 다운로드하십시오.
열차 주석을 내부 형식으로 변환합니다. python scripts/prepare_train_labels.py --labels <COCO_HOME>/annotations/person_keypoints_train2017.json 실행하십시오. 내부 형식 주석으로 변환 된 prepared_train_annotation.pkl 생성합니다.
[선택 사항] 빠른 유효성 검사의 경우 유효성 검사 데이터 세트의 하위 세트를 작성하는 것이 좋습니다. python scripts/make_val_subset.py --labels <COCO_HOME>/annotations/person_keypoints_val2017.json 실행하십시오. 250 개의 임의의 이미지 (5000)에 대한 주석이 달린 val_subset.json 생성합니다.
Mobilenet weights에서 훈련하려면 python train.py --train-images-folder <COCO_HOME>/train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder <COCO_HOME>/val2017/ --checkpoint-path <path_to>/mobilenet_sgd_68.848.pth.tar --from-mobilenet
다음, 이전 단계에서 검문소에서 훈련하기 위해 python train.py --train-images-folder <COCO_HOME>/train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder <COCO_HOME>/val2017/ --checkpoint-path <path_to>/checkpoint_iter_420000.pth --weights-only
Finally, to train from checkpoint from previous step and 3 refinement stages in network, run python train.py --train-images-folder <COCO_HOME>/train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder <COCO_HOME>/val2017/ --checkpoint-path <path_to>/checkpoint_iter_280000.pth --weights-only --num-refinement-stages 3 . 우리는 370000 회복 후 최종 반복 후 체크 포인트를 가져갔습니다.
우리는 어떤 단계에서도 최상의 체크 포인트 선택을 수행하지 않았으므로 반복 수가 적은 후에도 유사한 결과가 달성 될 수 있습니다.
최대 개방 파일 수 ( ulimit -n )의 수치 로이 오류가 1024와 동일합니다.
File "train.py", line 164, in <module>
args.log_after, args.val_labels, args.val_images_folder, args.val_output_name, args.checkpoint_after, args.val_after)
File "train.py", line 77, in train
for _, batch_data in enumerate(train_loader):
File "/<path>/python3.6/site-packages/torch/utils/data/dataloader.py", line 330, in __next__
idx, batch = self._get_batch()
File "/<path>/python3.6/site-packages/torch/utils/data/dataloader.py", line 309, in _get_batch
return self.data_queue.get()
File "/<path>/python3.6/multiprocessing/queues.py", line 337, in get
return _ForkingPickler.loads(res)
File "/<path>/python3.6/site-packages/torch/multiprocessing/reductions.py", line 151, in rebuild_storage_fd
fd = df.detach()
File "/<path>/python3.6/multiprocessing/resource_sharer.py", line 58, in detach
return reduction.recv_handle(conn)
File "/<path>/python3.6/multiprocessing/reduction.py", line 182, in recv_handle
return recvfds(s, 1)[0]
File "/<path>/python3.6/multiprocessing/reduction.py", line 161, in recvfds
len(ancdata))
RuntimeError: received 0 items of ancdata
제거하려면 더 큰 수로 한도를 늘리십시오 (예 : 65536), 터미널에서 실행 : ulimit -n 65536
python val.py --labels <COCO_HOME>/annotations/person_keypoints_val2017.json --images-folder <COCO_HOME>/val2017 --checkpoint-path <CHECKPOINT> 이 모델은 평면 BGR 형식에서 정규화 된 이미지 (평균 = [128, 128, 128], scale = [1/256, 1/256, 1/256])를 기대합니다. Coco 모델에서 미리 훈련 된 것은 https://download.01.org/opencv/openvino_training_extensions/models/human_pose_estimation/checkpoint_370000.pth 에서 사용할 수 있습니다.
python scripts/convert_to_onnx.py --checkpoint-path <CHECKPOINT> . human-pose-estimation.onnx 생성합니다.python <OpenVINO_INSTALL_DIR>/deployment_tools/model_optimizer/mo.py --input_model human-pose-estimation.onnx --input data --mean_values data[128.0,128.0,128.0] --scale_values data[256] --output stage_1_output_0_pafs,stage_1_output_1_heatmaps . 이것은 단일 정밀 부동산 지점 형식 (FP32)으로 모델 human-pose-estimation.xml 과 weights human-pose-estimation.bin 생성합니다. C ++ 데모는 Intel® OpenVino ™ 툴킷에서 찾을 수 있습니다. 해당 모델은 human-pose-estimation-0001 입니다. 공식 지시를 따르면 실행하십시오.
빠른 결과 미리보기를 위해 Python Demo를 제공합니다. 최고의 성능을 위해 C ++ 데모를 고려하십시오. 웹캠에서 파이썬 데모를 실행하려면 :
python demo.py --checkpoint-path <path_to>/checkpoint_iter_370000.pth --video 0 이것이 연구에 도움이된다면 논문을 인용하십시오.
@inproceedings{osokin2018lightweight_openpose,
author={Osokin, Daniil},
title={Real-time 2D Multi-Person Pose Estimation on CPU: Lightweight OpenPose},
booktitle = {arXiv preprint arXiv:1811.12004},
year = {2018}
}