Skip to content

Person tracking and attribute recognition system using YOLOv8, BoT-SORT, and Multi-Task CNN. Detects line crossings and recognizes gender, bag, and hat attributes in video streams.

Notifications You must be signed in to change notification settings

AngeloMolinario/PAR_tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artificial Vision Group 1 - Person Tracking and Attribute Recognition

This project implements a system for tracking people in video streams, detecting line crossings, and recognizing attributes such as gender, bag presence, and hat presence. It utilizes YOLO for object detection and a custom Multi-Task CNN for attribute recognition (PAR).

Description

The tracker.py script processes video files to:

  1. Track People: Uses YOLOv8 (or YOLOv8-seg) and BoT-SORT for robust person tracking.
  2. Detect Line Crossings: Counts people crossing defined lines in specific directions.
  3. Recognize Attributes: Classifies detected people for:
    • Gender: Male / Female
    • Bag: Yes / No
    • Hat: Yes / No

Libraries Used

The project relies on the following key libraries:

  • Ultralytics YOLO: For object detection and tracking.
  • PyTorch: Deep learning framework for the PAR model.
  • OpenCV (cv2): Video processing and drawing visualizations.
  • NumPy: Numerical operations.
  • Shapely: Geometric operations for polygon containment and line intersections.
  • Pillow (PIL): Image manipulation.

Usage

To run the tracker on a video file:

python tracker.py --input <path_to_video> --output <path_to_output> --config <path_to_config>

Arguments

Argument Default Description
--input ../video.mp4 Path to the input video file.
--output ./output/output.mp4 Path where the processed video will be saved.
--config ./config/camera.json Path to the camera configuration file (defines lines and zones).

Example

python tracker.py --input data/my_video.mp4 --output results/tracked_video.mp4

Alternatively, you can run the script with the default arguments:

python tracker.py

Authors

About

Person tracking and attribute recognition system using YOLOv8, BoT-SORT, and Multi-Task CNN. Detects line crossings and recognizes gender, bag, and hat attributes in video streams.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages