GroupInteractionTracker is a Python project for real-time person detection, pose estimation, and group interaction visualization from an RTSP camera feed.
- Person detection and tracking using YOLO and ByteTrack.
- Human pose estimation and orientation calculation.
- Group interaction detection based on proximity and movement.
- Segmentation masks using SAM2 for more accurate person centroids.
- Overlay visualization with bounding boxes, IDs, orientation, and group lines.
- Python 3.10+ (Python 3.11 recommended)
- GPU recommended for best performance with YOLO and SAM2
models/yolov8n.ptmodel file present in the repository- Dependencies installed from
requirements.txt
- Open a terminal in the repository root:
cd D:\texa\GroupInteractionTracker- Create and activate a virtual environment:
python -m venv venv
.\venv\Scripts\Activate.ps1- Install the required packages:
pip install -r requirements.txtUpdate src/config.py with your RTSP camera connection and settings:
RTSP_URL = "rtsp://username:password@camera_ip"You can also adjust:
FRAME_WIDTHandFRAME_HEIGHTCONFIDENCESAM_UPDATE_INTERVALGROUP_DISTANCEINTERACTION_TIME
From the repository root, run:
python src/main.pyThe application reads frames from the RTSP stream, performs detection, pose estimation, mask extraction, and displays results with group interaction overlays.
src/- Main Python source codemodels/- YOLO model filesassets/- Additional resources used by the projectlogs/- Output logsrequirements.txt- Python dependencies
- The project uses
ultralyticsfor YOLO tracking and the SAM2 repository for image segmentation. - Make sure the model files are available and the RTSP stream is accessible before running.
- For GitHub, commit the README and any project changes together.