This project captures a drawing/photo, extracts a person-like skeleton from the image using a vision model API, and animates a dancing figure with Pygame.
conda create --name animated_drawings python=3.8.13
conda activate animated_drawings
# clone AnimatedDrawings and use pip to install
git clone https://github.com/facebookresearch/AnimatedDrawings.git
cd AnimatedDrawings
pip install -e .
git clone https://github.com/Bobous2017/DrawBot-Studio/robot_agent.git
cd robot_agentpython -m venv .venv
.\.venv\Scripts\Activate.ps1If PowerShell blocks activation, run once:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedpython3 -m venv .venv
source .venv/bin/activateThis project currently does not include a requirements.txt, so install directly:
pip install opencv-python numpy pygame requests python-dotenv openaiCreate or edit .env in the project root:
Agent_API_Key=your_api_key_here
Agent_URL=https://ai/api/v1/chat/completions
Agent_MODEL=my_agent_module
Notes:
- `Agent_API_Key` and `Agent_URL` are required.
- `Agent_MODEL` is optional in code, but recommended to set explicitly.
- Do not commit real API keys to git.
## 6) Run the app
```bash
python main.pyFlow:
- Camera window opens.
- Press
Spaceto capture image, orEscto cancel. - Background is cut from the captured figure.
- Vision model extracts joints.
- Pygame opens and runs dance animation.
python test_pygame.pyThis prints installed library versions to verify setup.
- Camera cannot open:
- Close other apps using webcam.
- Check OS camera permissions.
- API request fails (400/401):
- Verify
Agent_API_Key,Agent_URL, andAgent_MODELin.env.
- Verify
- Pygame/OpenCV window does not show:
- Make sure you are running in a desktop GUI session (not headless).
- Update GPU/video drivers if needed.
ModuleNotFoundError:- Confirm virtual environment is activated and dependencies are installed.
main.py: Main app flow.capture_picture.py: Captures image from webcam.rigger_figure.py: Removes background and creates transparent figure PNG.vision_agent_module.py: Calls vision API to extract joints.dance_module.py: Animates skeleton/figure with Pygame.test_pygame.py: Basic dependency/version check.