Tmanna commited on
Commit
a04c653
Β·
verified Β·
1 Parent(s): e77f648

Fine-tuned YOLOv8n face detection for Bengali video captioning (WiderFace)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ confusion_matrix.png filter=lfs diff=lfs merge=lfs -text
37
+ results.png filter=lfs diff=lfs merge=lfs -text
38
+ test_inference.png filter=lfs diff=lfs merge=lfs -text
39
+ val_batch0_pred.jpg filter=lfs diff=lfs merge=lfs -text
DATASET_CARD.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - face-detection
6
+ - yolov8
7
+ - wider-face
8
+ - object-detection
9
+ license: apache-2.0
10
+ task_categories:
11
+ - object-detection
12
+ source_datasets:
13
+ - wider_face
14
+ ---
15
+
16
+ # Dataset Card β€” WiderFace for YOLO Training
17
+
18
+ ## Source
19
+
20
+ Kaggle: [lylmsc/wider-face-for-yolo-training](https://www.kaggle.com/datasets/lylmsc/wider-face-for-yolo-training)
21
+
22
+ ## Used To Train
23
+
24
+ [Tmanna/yolov8-face-bengali-video](https://huggingface.co/Tmanna/yolov8-face-bengali-video)
25
+
26
+ ## Format
27
+
28
+ YOLO annotation format:
29
+ ```
30
+ # Each label .txt file:
31
+ # class_id cx cy width height (all normalized 0–1)
32
+ 0 0.512 0.340 0.125 0.210
33
+ ```
34
+
35
+ ## Class Map
36
+
37
+ | ID | Class |
38
+ |----|-------|
39
+ | 0 | face |
40
+
41
+ ## Stats
42
+
43
+ | Split | Images |
44
+ |-------|--------|
45
+ | Train | ~12,880 |
46
+ | Val | ~3,226 |
47
+
48
+ ## Original Dataset
49
+
50
+ WiderFace by Shuo Yang et al. β€” the standard benchmark for face detection
51
+ covering extreme scale, pose, occlusion, expression and illumination variation.
52
+
53
+ ## Preprocessing
54
+
55
+ - Converted to YOLO annotation format
56
+ - Resized to 640Γ—640 during training
57
+ - Augmentations: mosaic, horizontal flip, rotation Β±10Β°, HSV jitter, scale, translate
README.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - bn
4
+ tags:
5
+ - object-detection
6
+ - face-detection
7
+ - yolov8
8
+ - ultralytics
9
+ - bengali-video
10
+ - caption-assignment
11
+ - wider-face
12
+ license: apache-2.0
13
+ datasets:
14
+ - lylmsc/wider-face-for-yolo-training
15
+ metrics:
16
+ - map
17
+ - precision
18
+ - recall
19
+ pipeline_tag: object-detection
20
+ base_model: ultralytics/yolov8n
21
+ ---
22
+
23
+ # YOLOv8n Face Detection β€” Bengali Video Caption Pipeline
24
+
25
+ ## Model Summary
26
+
27
+ Fine-tuned **YOLOv8n** for face/person detection in Bengali video frames.
28
+ Part of a Bengali video auto-captioning system that combines:
29
+ - **This model** β†’ detects visible faces in frames
30
+ - **[Tmanna/whisper-bengali-final](https://huggingface.co/Tmanna/whisper-bengali-final)** β†’ Bengali speech-to-text
31
+ - **Rule-based visibility filter** β†’ shows caption only when face is on screen
32
+
33
+ ## Pipeline Architecture
34
+ ```
35
+ Video
36
+ ↓
37
+ Audio ──→ Whisper (Tmanna/whisper-bengali-final) ──→ Bengali caption text
38
+ ↓
39
+ Frames ──→ THIS MODEL (YOLOv8 Face Detection)
40
+ ↓
41
+ Visibility Filter (rule-based: len(boxes) > 0)
42
+ ↓
43
+ IF face visible β†’ overlay Bengali caption
44
+ ELSE β†’ skip caption for this frame
45
+ ```
46
+
47
+ ## Training Details
48
+
49
+ | Parameter | Value |
50
+ |---------------|-------|
51
+ | Base Model | `yolov8n.pt` (Ultralytics) |
52
+ | Dataset | [lylmsc/wider-face-for-yolo-training](https://www.kaggle.com/datasets/lylmsc/wider-face-for-yolo-training) |
53
+ | Classes | 1 (`face`) |
54
+ | Epochs | 50 |
55
+ | Image Size | 640 Γ— 640 |
56
+ | Batch Size | 32 |
57
+ | Hardware | 2Γ— NVIDIA T4 (Kaggle) |
58
+ | Optimizer | AdamW + Cosine LR decay |
59
+ | Early Stop | patience=10 |
60
+
61
+ ## Evaluation Results
62
+
63
+ | Metric | Score |
64
+ |--------------|-------|
65
+ | mAP@0.5 | 0.6994 |
66
+ | mAP@0.5:0.95 | 0.3665 |
67
+ | Precision | 0.8556 |
68
+ | Recall | 0.6104 |
69
+
70
+ ## Usage
71
+ ```python
72
+ from ultralytics import YOLO
73
+
74
+ model = YOLO("Tmanna/yolov8-face-bengali-video")
75
+
76
+ # On a video frame (numpy array or image path)
77
+ results = model("frame.jpg", conf=0.25)
78
+
79
+ faces = results[0].boxes
80
+ if len(faces) > 0:
81
+ print("Face visible β†’ show Bengali caption")
82
+ else:
83
+ print("No face β†’ skip caption")
84
+ ```
85
+
86
+ ## Visibility Filter (no extra model needed)
87
+ ```python
88
+ def should_show_caption(frame_path, face_model, conf=0.25):
89
+ results = face_model(frame_path, conf=conf, verbose=False)
90
+ return len(results[0].boxes) > 0 # True = show, False = hide
91
+ ```
92
+
93
+ ## What This Model Does NOT Handle
94
+
95
+ | Module | Status | Reason |
96
+ |--------|--------|--------|
97
+ | Bengali STT | βœ… Handled by `Tmanna/whisper-bengali-final` | Pre-existing model |
98
+ | Translation | ❌ Not needed | Englishβ†’Bengali not required |
99
+ | Speaker Diarization | ⚠️ Optional | Not in core pipeline |
100
+ | Face Tracking (DeepSORT) | ⚠️ Optional | Not in core pipeline |
101
+ | Active Speaker Detection | πŸ”΄ Hard/Optional | Not in core pipeline |
best.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bb87b25bdc77e7641e7b768968b855cc9dce18cf03a32d0c0f565599edb5292
3
+ size 6236010
confusion_matrix.png ADDED

Git LFS Details

  • SHA256: 8df1f66d5e2a23e6c8a770da080381c1d0485b43273438d30f4a450ac73ad6d3
  • Pointer size: 131 Bytes
  • Size of remote file: 105 kB
dataset_config.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ names:
2
+ - face
3
+ nc: 1
4
+ path: /kaggle/working/wider_split
5
+ train: train/images
6
+ val: val/images
last.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae322d7d7be254e99dbf0b52aa8f21cc299477503ade4d03ea3c377aded9027c
3
+ size 6236010
metrics.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "mAP50": 0.6994216701471736,
3
+ "mAP50-95": 0.36653675270342345,
4
+ "Precision": 0.8555835854819701,
5
+ "Recall": 0.6104471858134156,
6
+ "dataset": "lylmsc/wider-face-for-yolo-training",
7
+ "base_model": "yolov8n.pt",
8
+ "epochs": 50,
9
+ "image_size": 640,
10
+ "hardware": "2x NVIDIA T4 (Kaggle)"
11
+ }
results.png ADDED

Git LFS Details

  • SHA256: e4932b2e02ca63e91f28ddddf8bb7c38538a21f69058f7510520c778c8cab388
  • Pointer size: 131 Bytes
  • Size of remote file: 283 kB
test_inference.png ADDED

Git LFS Details

  • SHA256: 09f5a99e6ace14476780903475a64466d9ece468956f9c1ec7bb91ecc409bde0
  • Pointer size: 132 Bytes
  • Size of remote file: 1.67 MB
val_batch0_pred.jpg ADDED

Git LFS Details

  • SHA256: 359a6cd5764b19967fbe01a1a241315ac454679f2a6ea205f87eede6897367c7
  • Pointer size: 131 Bytes
  • Size of remote file: 417 kB