Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

People Instance Segmentation using YOLOv8

A lightweight computer vision project that performs instance segmentation of people using Ultralytics YOLOv8. The repository demonstrates an end-to-end deep learning workflow—from dataset preparation and annotation conversion to model training, evaluation, and inference on both images and video.


Demo

People Instance Segmentation Demo


Project Highlights

  • Trained a YOLOv8n-Seg model for people instance segmentation.
  • Converted annotations from COCO format to YOLO segmentation format.
  • Performed dataset verification and train/validation/test splitting.
  • Achieved high segmentation accuracy while remaining suitable for CPU inference.
  • Demonstrated inference on both images and video.
  • Organised into a clean, reproducible project structure.

Qualitative Results


Model Performance

Bounding Box Performance

Metric Score
Precision 0.991
Recall 0.956
mAP@50 0.977
mAP@50-95 0.885

Segmentation Performance

Metric Score
Precision 0.988
Recall 0.952
mAP@50 0.968
mAP@50-95 0.848

The trained model demonstrated strong localisation and segmentation performance on the validation dataset while remaining lightweight enough for CPU-based inference.


Repository Structure

people_instance_segmentation/
├── assets/
├── data/
├── dataset/
├── models/
├── outputs/
├── reports/
├── scripts/
├── videos/
├── data.yaml
├── requirements.txt
├── README.md
├── LICENSE
└── .gitignore

Installation

Clone the repository

git clone https://github.com/only1jamjam-ctrl/people_instance_segmentation-yolov8.git

Move into the project

cd people_instance_segmentation

Install the required packages

pip install -r requirements.txt

Training

yolo segment train \
model=yolov8n-seg.pt \
data=data.yaml \
epochs=50 \
imgsz=640 \
batch=8 \
project=runs \
name=people_seg

Inference

Images

yolo segment predict \
model=models/best.pt \
source=data/images/test \
save=True

Video

yolo segment predict \
model=models/best.pt \
source=outputs/demovideo.mp4 \
save=True

Project Workflow

flowchart LR

A[Dataset] --> B[COCO to YOLO Conversion]
B --> C[Dataset Verification]
C --> D[Train / Validation / Test Split]
D --> E[YOLOv8 Training]
E --> F[Model Evaluation]
F --> G[Image Prediction]
G --> H[Video Prediction]
H --> I[GIF Generation]
Loading

Key Achievements

  • Trained a YOLOv8n-Seg model for 50 epochs.
  • Achieved 0.968 Mask mAP@50 and 0.977 Box mAP@50.
  • Built a complete COCO → YOLO segmentation preprocessing pipeline.
  • Performed image and video inference using the trained model.
  • Generated deployment-ready prediction outputs and demonstration GIF.
  • Designed a clean, reproducible repository structure for future development.

Limitations

Although the model performs well on standard scenes, some challenging scenarios remain:

  • Crowded scenes with heavy occlusion may reduce detection accuracy.
  • Human-like objects such as dolls or mannequins can occasionally produce false positives.
  • Performance can be further improved using a larger and more diverse training dataset.

Future Work

  • Train using a larger dataset.
  • Evaluate larger YOLOv8 segmentation backbones.
  • Improve robustness on crowded scenes.
  • Reduce false positives through hard-negative examples.
  • Deploy the model for real-time webcam inference.

License

Released under the MIT License.

About

End-to-end people instance segmentation using YOLOv8 with images, video and GIF demonstrations.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages