Imported from XXXws/pytorch-openpose (
AGENTS.md). Install upstream withnpx skills add XXXws/pytorch-openpose. Copyright stays with the author.
Repository Guide: PyTorch OpenPose
Overview
This project provides a web-based pose detection system using PyTorch.
The repository contains a Python backend powered by FastAPI and a
Vue.js frontend for user interaction. Core OpenPose logic resides in
src/ and is wrapped into API services under app/.
├── app/ # FastAPI backend (routes & services)
├── src/ # PyTorch OpenPose models and utilities
├── frontend/ # Vue 3 web client
├── model/ # Pretrained model files (not included)
├── images/ # Sample images for demos
├── results/ # Output files (ignored by git)
Backend
- Entry point:
python -m app.main(uses FastAPI and uvicorn) - Configuration: see
app/config.pyfor paths and log level. - API modules: located in
app/api/(detection, video, realtime, health). - Core services:
app/core/implements detection service, video tasks, performance monitoring and FFmpeg utilities. - Pose models: defined in
src/model.pywith wrappers insrc/body.pyandsrc/hand.py.
Coding style
- Follow PEP8 conventions; use four spaces for indentation.
- Keep line length under 120 characters.
- Prefer explicit logging via the
loggingmodule (seeapp/logger.py). - Public APIs should return JSON-friendly structures or Pydantic models.
Frontend
- Located under
frontend/using Vue 3 and Element Plus. - Development:
npm run dev(default port 3000). - Build for production:
npm run build.
Installation
- Install Python dependencies:
pip install -r requirements.txt - Download pretrained models into the
model/directory:body_pose_model.pthhand_pose_model.pth
- (Optional) install front‑end dependencies:
cd frontend && npm install
Running
- Backend:
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8001 - Frontend:
npm run devfromfrontend/. - API documentation available at
http://localhost:8001/docs.
Notes for Contributors
- Tests are not provided; manual verification via starting the server is recommended after changes.
- When adding new Python modules, place them within the appropriate
package (
appfor API/service code,srcfor model logic). - Keep dependencies minimal and update
requirements.txtwhen new packages are required. - Avoid committing large model files or result media; these paths are
already listed in
.gitignore.