이거 때문에 두 달은 날린 것 같다.
사실 좀 더 내가 똑똑했거나...파이썬을 잘 알았다면 정말 쉽게 끝났을 텐데...
수많은 스택 오버 플로우와 깃 이슈를 살펴봤다.
1. anaconda 환경 세팅
🍎 m2 환경에서 무작정 아나콘다로 하지 마시고 miniforge를 설치 해야 된다는걸 수많은 구글링으로 알았습니다.
저처럼 하시면 채널 오류랑 라이브러리가 충돌나서 3일동안 고생을 하고 아나콘다 환경을 다 날리고 재설치 하게 됩니다.
1-1. 일단 openpose 환경을 세팅한다.
이유: smplify랑 numpy 버전이 차이나기 때문이다. 이거때문에 trimesh 설치를 하지 못하는 오류를 겪었다.
아나콘다 환경을 만들었다는 가정 하에 실행한다.
conda create -n openpose
conda activate openpose
https://github.com/franzcrs/openpose-with-caffe-for-MacM1
감사하게도 누가 mac에서 openpose 오류가 났던 C++코드를 싹 다 바꿔주심.
이거 때문에 작년에 포기했는데 수많은 구글링을 통해 얻음.
맥이 아닌 경우에는 https://github.com/CMU-Perceptual-Computing-Lab/openpose
GitHub - CMU-Perceptual-Computing-Lab/openpose: OpenPose: Real-time multi-person keypoint detection library for body, face, hand
OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation - CMU-Perceptual-Computing-Lab/openpose
github.com
기본 오픈포즈 링크에 가서 설치
1. conda install python=3.9
여기서 Verifying transaction: / WARNING conda.core.path_actions:verify(1050): Unable to create environments file. Path not writable. 라는 에러를 만나면,
-> 해결: sudo chmod -R 775 /Users/vecherish/.conda (권한부여)
bash scripts/osx/install\_deps.sh**
mkdir build
cd build
cmake gui가 없으면 설치해야한다.
cmake-gui .. # build\_caffe , CPU\_ONLY 체크**
make -j\`sysctl -n hw.logicalcpu
openpose가 잘 되는지 확인하는법 : ./build/examples/openpose/openpose.bin
- 아마 웹 캠이 활성화 될 거임.
openpose 내 파일 테스트
- 내 이미지 경로를 넣어주면 된다.
./build/examples/openpose/openpose.bin --image_dir /Users/vecherish/Desktop/gradsmu/smplifyx/content/data/images --write_json /Users/vecherish/Desktop/gradsmu/smplifyx/content/keypoints --face --hand --display 0 --write_images /Users/vecherish/Desktop/gradsmu/smplifyx/content/openpose_images
1-2. smplify 환경을 세팅한다.
create -n simplify
conda activate smplfiy
!pip install chumpy
!pip install smplx
!git clone [https://github.com/vchoutas/smplx](https://github.com/vchoutas/smplx)
%cd smplx
!python setup.py install
pip install git+[https://github.com/nghorbani/configer](https://github.com/nghorbani/configer)
여기까지는 순조롭게 될 것이다.
human_body_prior 관련 오류
ImportError: cannot import name 'load\_model' from 'human\_body\_prior.tools.model\_loader'
실행 시 이런 오류가 뜰거임.
window 에서도 해봤으나 똑같이 오류가 났음.
직접 빌드하면 됨.. 이걸 하루동안 붙잡았다니
- https://github.com/nghorbani/human_body_prior 참고
python setup.py develop
pip install -r requirements.txt
그담에 대망의 smplify-x를 실행
cd Smplify-X-Perfect-Implementation
pip install -r requirements.txt
후에 없다고 뜨는거 걍 pip install 하면 됨 뭐였는지 기억이 안 나네..
실행 명령어
python smplifyx/main.py --config cfg\_files/fit\_smplx.yaml --data\_folder /Users/vecherish/Desktop/gradsmu/smplifyx/content/data --output\_folder /Users/vecherish/Desktop/gradsmu/smplifyx/content/data/smplify\_results --visualize False --gender female --model\_folder /Users/vecherish/Desktop/gradsmu/smplifyx/content/models --vposer\_ckpt /Users/vecherish/Desktop/gradsmu/smplifyx/content/models/vposer/V02\_05 --part\_segm\_fn smplx\_parts\_segm.pkl
자신의 경로를 넣으면 된다.
참고
여러 깃 이슈들, 스택 오버 플로우
'SCHOOL > 캡스톤' 카테고리의 다른 글
[졸프 백엔드] CORS (0) | 2024.08.05 |
---|---|
[캡스톤 딥러닝] M2 MAC에서 SMPL-ANthropometry (4) | 2024.07.24 |
[졸프 서버] 시작 전 서버 구상도! (0) | 2024.07.01 |
[졸프 백엔드] [버그 수집] logout 시 "detail": "method 'get' is not supported." (0) | 2024.07.01 |
[졸프 백엔드] JWT로 로그아웃 구현하기 2 (0) | 2024.07.01 |