Diagram Alur Arsitektur & Pipeline Data Sistem Retraining Karung
Diagram Alur Arsitektur 8-Tahap: Video Ingest, FFmpeg Slicing, SAM3 Grounding, Review Canvas, Data Prep & Triage, Master Dataset, YOLO Retraining, Live Inference & Benchmark
2026-08-27T00:00:00Z
Retraining Studio FODG Specification Generator
Sistem Retraining & Live Counter Feedmill — Arsitektur & Pipeline Data 8 Tahap
Pipeline Closed-Loop End-to-End: Ingest CCTV 06:00, Ekstraksi FFmpeg, Auto-Label SAM3, Review Canvas, Triage Data, Dataset Freezing, YOLO Retraining & Live Inference
1. Video Archive & CCTV Ingest
Siklus 24 Jam (06:00 Cutoff) & Ingestion
[RTSP :8554] [06:00 Cutoff] [Sidecar JSON]
• Ingest stream Dahua RTSP :8554 / WHEP :8889
• Pengenalan OCR timestamp video otomatis
• Partisi batch per hari kerja feedmill (06:00-05:59)
• Metadata sidecar JSON & storage read-only
IN: RTSP Stream / Batch MP4 | OUT: Indexed Video
2. Video Library & FFmpeg Slicing
Sub-Sampling Engine & Frame Extraction
[FFmpeg 1.0 FPS] [Range Trim] [%06d.jpg]
• Range streaming & visual time-range trimmer
• Ekstraksi frame presisi (default: 1.0 FPS)
• Penulisan sekuens zero-padded 000001.jpg
• Atomic write ke data/batches/<batch-id>/frames/
IN: Video Batch + Range | OUT: JPG Frames
3. SAM3 Grounding Engine
Singleton CUDA & Zero-Shot Auto-Label
[Singleton GPU] [1 set_image] [Exemplar Pool]
• Singleton CUDA manager (1 set_image per frame)
• Multi-prompt zero-shot grounding per kelas
• Cross-prompt NMS & ekstraksi polygon mask
• Exemplar visual tuning (positive/negative points)
IN: JPG Frames + Prompts | OUT: Polygon Labels
4. Review Canvas & Editor
Dark-Mode Interactive Workspace
[Dark Canvas] [Vertex/BBox] [Hotkeys Space/W/D]
• Manipulasi interaktif vertex polygon & bounding box
• Hotkey efisiensi (Space approve, W triage, D delete)
• Re-assignment kelas label & filmstrip quick reclass
• Pelacakan sumber (auto SAM3 vs manual edit)
IN: Candidate Labels | OUT: Approved Annotations
5. Data Prep & Outlier Triage
Multi-Signal Quality Filter & Augment
[Scatter Plot] [Crop Grid] [Augment Presets]
• Filter keep-ranges (score, area_pct, aspect_ratio)
• Scatter plot interaktif (Score x Area) & crop grid
• Manual override per bounding box (keep/ignore)
• Preset augmentasi (Off, Light, Medium, Aggressive)
IN: Approved Batches | OUT: Filtered Annotations
6. Master Dataset Freezing
Deterministic Immutable Repository
[SHA1 Stable Val] [Immutable] [YOLO TXT]
• Val split stabil permanen berbasis hash SHA1
• Ekspor label format YOLO TXT (class x y w h)
• Generasi manifest data.yaml & snapshot rules
• Integrasi base datasets eksternal (train-only)
IN: Filtered Labels | OUT: dataset/ train/ val/
7. YOLO Retraining & Benchmark
Ultralytics Fine-Tuning & Evaluation
[Ultralytics YOLO11] [mAP Compare] [Auto VRAM]
• Fine-tuning YOLO11 dari base model terdaftar
• VRAM auto-tuning & hardware agnostic execution
• Evaluasi otomatis metrik mAP50 & mAP50-95
• Ekspor model terbaik best.pt & log metrics.json
IN: Master Dataset | OUT: best.pt + Metrics
8. Live Inference & Counter
Real-Time Belt Counting & Benchmark
[ByteTrack] [LineCross y1] [WHEP Stream :8889]
• ByteTrack tracking & tripwire line cross (y1 edge)
• Deploy best.pt ke runtime menghitung-karung
• Stream low-latency WHEP di UI operator (:5000)
• Headless benchmark otomatis vs Ground Truth Excel
IN: best.pt + Live Video | OUT: Real-Time Counts
Infrastruktur & Storage Bus Terintegrasi
• Storage Hierarchy: data/app.db (SQLite WAL) | data/projects/<slug>/dataset/ (Images, Labels, data.yaml) | data/batches/ (Frames 1.0 FPS) | models/<v>/best.pt
• Port Matrix: Web UI (:8080) | FastAPI REST API (:8000) | Frontend Dev (:5173) | Operator Live Counter (:5000) | CCTV RTSP (:8554) | MediaMTX WHEP (:8889)
• Operational Invariants: 1. Val Split Stabil Permanen (SHA1 Hash) | 2. 1 set_image() Per Image di SAM3 | 3. Video Archive Read-Only | 4. Dynamic GPU Auto-Tuning