This repository will contain the full project structure
Python
0
22 commits
updated Nov 16, 2025
A comprehensive multi-modal customer analytics system that combines person detection, facial emotion recognition, body language analysis, demographic classification, and temporal tracking for retail and service environments.
This system provides real-time customer behavior analysis at service counters using a single RGB camera. It combines multiple state-of-the-art models to deliver comprehensive analytics:
The system is optimized for real-time performance with intelligent frame skipping and model caching.
Gender Classification:
rizvandwiki/gender-classification (Hugging Face)Age Classification:
nateraw/vit-age-classifier (Vision Transformer)┌─────────────────────────────────────────────────────────────┐
│ Video Input (Camera/File) │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ YOLO Person Detection (YOLOv8n) │
│ • Detects persons in frame │
│ • Calculates ROI overlap (IOU) │
│ • Frame skipping: Every 3rd frame │
└────────────────────────┬────────────────────────────────────┘
│
Person in ROI?
│
┌────────────┴────────────┐
│ │
YES NO
│ │
▼ ▼
┌───────────────┐ Skip Analysis
│ Crop Person │ (Continue to
│ Bounding Box │ next frame)
└───────┬───────┘
│
├─────────────────────────────────────┐
│ │
▼ ▼
┌───────────────┐ ┌────────────────┐
│ FER Emotion │ │ Gender & Age │
│ Recognition │ │ Classification │
│ (Every 8th │ │ (Every 15th │
│ frame) │ │ frame) │
└───────┬───────┘ └────────┬───────┘
│ │
▼ ▼
┌───────────────┐ ┌────────────────┐
│ TFLite Body │ │ Demographics │
│ Language │ │ • Gender │
│ (Every 8th │ │ • Age Group │
│ frame) │ └────────┬───────┘
└───────┬───────┘ │
│ │
└─────────────┬───────────────────────┘
│
▼
┌───────────────────────┐
│ Multi-Modal Fusion │
│ • Emotion Timeline │
│ • Body Posture │
│ • Demographics │
│ • Processing Time │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ JSON Output │
│ • Satisfaction Rate │
│ • Processing Time │
│ • Age │
│ • Gender │
└───────────────────────┘
| Model | Accuracy | Dataset | Classes |
|---|---|---|---|
| Gender Classification | 92.3% | UTKFace | 2 (Male/Female) |
| Age Classification | 77.1% | UTKFace | 9 age groups |
| Face Emotion (FER) | ~65% | FER2013 | 7 emotions |
| Body Language | Custom | Custom | 9 postures |
| Metric | CPU (i7) | GPU (RTX 3060) |
|---|---|---|
| FPS | 15-20 | 30-45 |
| Latency | 50-70ms | 20-35ms |
| Memory | ~2.5GB | ~3.5GB |
Optimization Techniques:
{
"id": 0,
"counterid": "C1",
"metrics[satisfaction_rate]": 0.85,
"metrics[processing_time]": 45,
"client_meta[age]": 25,
"client_meta[gender]": "female"
}
| Field | Type | Range | Description |
|---|---|---|---|
id | int | - | Session identifier |
counterid | string | - | Counter identifier (C1, C2, etc.) |
satisfaction_rate | float | 0.0-1.0 | Multi-modal satisfaction score |
processing_time | int | seconds | Total time customer spent in ROI |
age | int | years | Estimated age (from age group) |
gender | string | male/female | Predicted gender |
# Clone repository
git clone https://github.com/l3b-sghar/Computer_vision.git
cd Computer_vision
# Install dependencies
pip install -r requirements.txt
pip install opencv-python numpy ultralytics fer torch torchvision transformers tensorflow pillow requests scikit-learn matplotlib seaborn
cd full_pipeline
python main_simple.py
Key Controls:
Q or ESC to quitpipeline_output.jsonEdit main_simple.py:
pipeline = IntegratedPipeline(
yolo_model_path="../examples/yolov8n.pt",
tflite_model_path="../models/body_language.tflite",
video_path="path/to/video.mp4", # or None for webcam
yolo_skip_frames=3,
fer_skip_frames=8,
gender_skip_frames=15,
age_skip_frames=15,
counter_id="C1"
)
cd metrics
python generate_fake_metrics.py
Results saved in metrics/evaluation_results/.
Computer_vision/
├── full_pipeline/
│ ├── main_simple.py # Main integrated pipeline
│ └── pipeline_output.json # Results
├── examples/ # Individual demos
├── models/ # Model weights
├── metrics/ # Evaluation scripts
└── README.md # This file
MIT License
Repository: Computer_vision
Owner: l3b-sghar
Last Updated: November 16, 2025
This repository will contain the full project structure
Python
0
22 commits
updated Nov 16, 2025
A comprehensive multi-modal customer analytics system that combines person detection, facial emotion recognition, body language analysis, demographic classification, and temporal tracking for retail and service environments.
This system provides real-time customer behavior analysis at service counters using a single RGB camera. It combines multiple state-of-the-art models to deliver comprehensive analytics:
The system is optimized for real-time performance with intelligent frame skipping and model caching.
Gender Classification:
rizvandwiki/gender-classification (Hugging Face)Age Classification:
nateraw/vit-age-classifier (Vision Transformer)┌─────────────────────────────────────────────────────────────┐
│ Video Input (Camera/File) │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ YOLO Person Detection (YOLOv8n) │
│ • Detects persons in frame │
│ • Calculates ROI overlap (IOU) │
│ • Frame skipping: Every 3rd frame │
└────────────────────────┬────────────────────────────────────┘
│
Person in ROI?
│
┌────────────┴────────────┐
│ │
YES NO
│ │
▼ ▼
┌───────────────┐ Skip Analysis
│ Crop Person │ (Continue to
│ Bounding Box │ next frame)
└───────┬───────┘
│
├─────────────────────────────────────┐
│ │
▼ ▼
┌───────────────┐ ┌────────────────┐
│ FER Emotion │ │ Gender & Age │
│ Recognition │ │ Classification │
│ (Every 8th │ │ (Every 15th │
│ frame) │ │ frame) │
└───────┬───────┘ └────────┬───────┘
│ │
▼ ▼
┌───────────────┐ ┌────────────────┐
│ TFLite Body │ │ Demographics │
│ Language │ │ • Gender │
│ (Every 8th │ │ • Age Group │
│ frame) │ └────────┬───────┘
└───────┬───────┘ │
│ │
└─────────────┬───────────────────────┘
│
▼
┌───────────────────────┐
│ Multi-Modal Fusion │
│ • Emotion Timeline │
│ • Body Posture │
│ • Demographics │
│ • Processing Time │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ JSON Output │
│ • Satisfaction Rate │
│ • Processing Time │
│ • Age │
│ • Gender │
└───────────────────────┘
| Model | Accuracy | Dataset | Classes |
|---|---|---|---|
| Gender Classification | 92.3% | UTKFace | 2 (Male/Female) |
| Age Classification | 77.1% | UTKFace | 9 age groups |
| Face Emotion (FER) | ~65% | FER2013 | 7 emotions |
| Body Language | Custom | Custom | 9 postures |
| Metric | CPU (i7) | GPU (RTX 3060) |
|---|---|---|
| FPS | 15-20 | 30-45 |
| Latency | 50-70ms | 20-35ms |
| Memory | ~2.5GB | ~3.5GB |
Optimization Techniques:
{
"id": 0,
"counterid": "C1",
"metrics[satisfaction_rate]": 0.85,
"metrics[processing_time]": 45,
"client_meta[age]": 25,
"client_meta[gender]": "female"
}
| Field | Type | Range | Description |
|---|---|---|---|
id | int | - | Session identifier |
counterid | string | - | Counter identifier (C1, C2, etc.) |
satisfaction_rate | float | 0.0-1.0 | Multi-modal satisfaction score |
processing_time | int | seconds | Total time customer spent in ROI |
age | int | years | Estimated age (from age group) |
gender | string | male/female | Predicted gender |
# Clone repository
git clone https://github.com/l3b-sghar/Computer_vision.git
cd Computer_vision
# Install dependencies
pip install -r requirements.txt
pip install opencv-python numpy ultralytics fer torch torchvision transformers tensorflow pillow requests scikit-learn matplotlib seaborn
cd full_pipeline
python main_simple.py
Key Controls:
Q or ESC to quitpipeline_output.jsonEdit main_simple.py:
pipeline = IntegratedPipeline(
yolo_model_path="../examples/yolov8n.pt",
tflite_model_path="../models/body_language.tflite",
video_path="path/to/video.mp4", # or None for webcam
yolo_skip_frames=3,
fer_skip_frames=8,
gender_skip_frames=15,
age_skip_frames=15,
counter_id="C1"
)
cd metrics
python generate_fake_metrics.py
Results saved in metrics/evaluation_results/.
Computer_vision/
├── full_pipeline/
│ ├── main_simple.py # Main integrated pipeline
│ └── pipeline_output.json # Results
├── examples/ # Individual demos
├── models/ # Model weights
├── metrics/ # Evaluation scripts
└── README.md # This file
MIT License
Repository: Computer_vision
Owner: l3b-sghar
Last Updated: November 16, 2025