Skip to content
Projects

About

YOLOv8-Pose-GUI Real-time pose estimation & sitting posture analysis. Input: image / video / camera. Detects: normal sitting, bowed head, hunchback, left/right tilt.

Design & Media

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+10
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en-US.md

Original

🧍‍♂️ YOLOv8-Pose Real-time Pose Detection System

English · 简体中文

Stars Latest release Python 3.8+ MIT License Code check

Out-of-the-box YOLOv8-Pose posture GUI
Detects 17 keypoints from images or a live camera and labels normal sitting, head bowing, slouching, and left/right tilt

Why star it? No training and no GPU required — install the dependencies and run. Angle math, skeleton drawing, multi-person handling, and Chinese labels are all packaged in src/main.py. If it saves you a day of environment setup and threshold tuning, a star is the best way to say thanks.

⚡ Quick Start

pip install -r requirements.txt
python src/main.py

Python 3.8+. Run from the repository root so yolov8n-pose.pt and times.ttf resolve.

Interface preview

During actual runtime, keypoints, skeletons, and posture labels for each person will be displayed.


📌 Features

  • 🖼️ Multiple Input Sources: Images, cameras, local video files (.mp4/.avi/.mov)
  • 🧠 High-Accuracy Pose Estimation: Based on YOLOv8-pose, supports 17 COCO keypoints
  • 🎯 Fine-grained Sitting Posture Analysis:
    • Normal sitting posture
    • Head bowing (neck bending angle)
    • Slouching/Hunchback (torso forward tilt angle)
    • Left tilt / Right tilt (shoulder height difference)
  • 🖥️ User-friendly GUI: Tkinter interface with real-time adjustable confidence, IoU, and pose judgment thresholds
  • 🚀 Real-time Performance: Runs smoothly in camera mode (30fps+)
  • 👥 Multi-person Detection: Supports simultaneous recognition and annotation of multiple humans in the frame

📦 Installation & Dependencies

Environment Requirements

  • Python 3.8 or higher
  • Anaconda or a virtual environment is recommended

Installation Steps

  1. Clone the Repository

    git clone https://github.com/aaron888hacker/-yolov8-.git
    cd -yolov8-
    
  2. Install Dependencies

    pip install -r requirements.txt
    

    requirements.txt contents:

    ultralytics>=8.0.0
    opencv-python>=4.5.0
    numpy>=1.21.0
    Pillow>=9.0.0
    
  3. Download Pre-trained Model
    Place yolov8n-pose.pt (or yolov8s-pose.pt / yolov8m-pose.pt) in the project root directory.
    Download link: Ultralytics Assets


🚀 Quick Start

  1. Run the GUI

    python src/main.py
    

    Run from the repository root so the relative paths of yolov8n-pose.pt and times.ttf resolve.

  2. Load Model: Click Load Model and wait for the "Model loaded" prompt.

  3. Select Input Source:

    • Image: Open Image → Select an image containing a person
    • Video File: Open Video → Select a .mp4/.avi file
    • Camera: Start Camera → Open the default camera
  4. Adjust Thresholds (takes effect in real-time):

    • Conf: Detection confidence (lowering it can detect smaller/blurred humans)
    • Tilt thresh: Sensitivity for body tilt judgment
    • Hunch (°): Hunchback angle threshold (values above this are judged as hunchback)
    • Bowed (°): Head bowing angle threshold (values above this are judged as head bowing)
  5. Stop: Click Stop to close the current video/camera.


⚙️ Configuration & Customization

Change Default Model

Modify self.model_path in YOLOv8Pose.__init__:

self.model_path = 'yolov8m-pose.pt'   # Use medium model to improve accuracy

Improve Small Object Detection

Increase the imgsz parameter in YOLOv8Pose.process_frame:

results = self.model.predict(..., imgsz=1280)  # Default is 640

Note: Higher resolution will increase GPU/CPU load.

Add New Pose Categories

Modify the decision logic in YOLOv8Pose.analyze_sitting_pose, or extend the return values of determine_pose.

Enable Chinese Labels

Change the fine_pose string to Chinese (e.g., '低头'), and ensure a Chinese-supporting font is used (e.g., times.ttf). In process_frame, you can replace cv2.putText with PIL drawing (refer to code comments).


📂 File Structure

.
├── src/main.py            # Main program (GUI + pose estimation core)
├── debug_pose.py          # Pose feature debugging script
├── yolov8n-pose.pt        # Pre-trained model
├── requirements.txt       # Dependency list (Python 3.8+)
├── times.ttf / STSONG.TTF # CJK fonts
├── res.json               # Sample detection output
├── docs/index.html        # GitHub Pages landing page
├── .github/workflows/     # Daily syntax and lint checks
├── README.md              # Chinese README
└── README.en-US.md        # English README (this file)

📊 Pose Labels Explanation

Label (English) Meaning Judgment Criteria
standing Standing Knees straight, hips higher than knees
sitting Sitting (Standard) Knees bent, hips higher than knees
sitting_low Low sitting Knees bent and positioned low
leaning Slight bend/Leaning Knee angle between 125°~160°
normal sitting Normal sitting Sitting posture with all angles within normal range
bowed head Head bowing Neck bending angle > threshold
hunchback Hunchback/Slouching Torso forward tilt angle > threshold
left tilt Body left tilt Right shoulder higher than left shoulder
right tilt Body right tilt Left shoulder higher than right shoulder
squat Squat Knee angle < 90°
unknown Unable to determine Keypoint confidence insufficient

🧪 Test Environment

  • OS: Windows 10/11, Ubuntu 20.04
  • Python: 3.11.4
  • GPU: NVIDIA RTX 3060 (Optional, runs on CPU as well)
  • Camera: Standard USB camera / Laptop built-in camera

🤝 Contributing Guidelines

Issues and Pull Requests are welcome. If you wish to add new features (e.g., posture logging, alert notifications, etc.), please open an Issue for discussion first.


📄 License

This project is licensed under the MIT License.


🙏 Acknowledgments


Star History

🔗 Related Projects

  • DeepSeek-web2api — OpenAI / Anthropic compatible API for DeepSeek Chat, with streaming, reasoning, and function calling.

📧 Contact

For questions or suggestions, please provide feedback via GitHub Issues.


⭐ If this project is helpful to you, please consider giving it a Star!

Explore related projects

Loading…