사용 데이터 (피트니스 자세 이미지 - AI 허브)
https://aihub.or.kr/aidata/8051
길고 긴 시간 끝에 docker 설치를 끝내고, 이미지 로드까지 성공했다!
Ubuntu 18.04 및 CUDA 10.1에 따라 개발PyTorch 1.3.1 사용${ROOT}
|-- data
|-- demo
|-- common
|-- main
|-- output
|-- tool
data contains data loading codes and soft links to images and annotations directories. demo contains demo codes.common contains kernel codes for FitNet. main contains high-level codes for training or testing the network. output contains log, trained models, visualized outputs, and test result. tool contains data pre-processing code (get_exercise_dict.py), which makes exercise_dict.json.여기서 main 폴더 안의 코드들이
neural network를 학습시키고 테스트할 수 있는 주요 코드들 ❗
${ROOT}
|-- data
| |-- Sleek
| |-- |-- data
| | | |-- exercise_dict.json
| | | |-- Day01_200921_F
| | | |-- Day02_200922_F
...
| | | |-- Day34_201106_F
${ROOT}
|-- main
| |-- config.py
| |-- model.py
| |-- run_test.py
| |-- run_train.py
| |-- test.py
| |-- train.py
${ROOT}
|-- output
| |-- log
| |-- model_dump
| |-- result
| |-- vis
output 폴더를 만드는 것이 좋음log folder contains training log file. model_dump folder contains saved checkpoints for each epoch. result folder contains final estimation files generated in the testing stage. vis folder contains visualized results. 3.7.3 버전 이상의 python과 본인의 OS에 맞는 pytorch 설치하기main/config.py에서 모델에 관한 하이퍼 파라미터 설정 가능 (network backbone and input size, ..)💡 두 가지 단계
exerattrstage의 인자 값으로 exer를 넘기면 운동의 종류, attr을 넘기면 운동의 상태를 학습1) exer
main 폴더 안에서 실행python train.py --gpu 0-3 --stage exer --exer_idx -1
--gpu 0-3 대신 --gpu 0,1,2,3 사용 가능2) attr
main 폴더 안에서 실행python train.py --gpu 0-3 --stage attr --exer_idx $EXER_IDX
--gpu 0-3 대신 --gpu 0,1,2,3 사용 가능$EXER_IDX는 data/Sleek/data/excise_dict.json에 정의된 exercise index💡 Batched training
exer, attr 단계에서 모든 운동에 대해 학습시킬 수 있는 batched training script 제공python run_train.py
output/model_dump/에 위치exer과 attr 중에서 테스트하고 싶은 단계 선택main 폴더 안에서 실행python test.py --gpu 0-3 --stage $STAGE --test_epoch 20 --exer_idx $EXER_IDX
--gpu 0-3 대신 --gpu 0,1,2,3 사용 가능$STAGE는 exer, attr 둘 중 하나여야 함$EXER_IDX는 $STAGE가 exer일 때 -1exercise_dict.json에서 선택💡 batched test
main 폴더 안에서 실행python run_test.py



