Why YOLO-P2?
The P2 prediction head works at a higher spatial resolution than conventional deeper heads. It preserves shallow feature detail that is useful when pedestrians, bicycles and vehicles occupy very few pixels in wide-area imagery.
The P2 prediction head works at a higher spatial resolution than conventional deeper heads. It preserves shallow feature detail that is useful when pedestrians, bicycles and vehicles occupy very few pixels in wide-area imagery.
Large scenes are not equally difficult. The system measures scene complexity, then chooses full-frame inference or overlapping 640/768-pixel tiles. It spends additional computation only when the policy judges that local detail requires it.
OpenVINO INT8 is the operational edge path: quantized weights, batch 1 and latency-oriented CPU execution. PyTorch FP32 is retained as a reference/fallback path. Backend agreement is not accuracy validation; use labelled evaluation data for that claim.
Detection and evidence generation are the useful analytical work. Re-encoding an annotated MP4 adds CPU time, disk writes and storage. Report-only mode keeps JSON, CSV and HTML evidence while avoiding that optional cost.
Checks file type, upload size and whether the media can be decoded before expensive model work starts.
Loads only the requested OpenVINO INT8 or PyTorch FP32 detector. Switching backend releases the previous detector where possible.
Confirms the detector, ten-class VisDrone label map, CPU device, batch-one policy and model runtime are available.
For video, selects frames using target inference FPS and maximum stride. A strong scene change can force an unscheduled inference.
Measures texture, blur/focus, entropy, brightness and contrast on a compact grayscale proxy. These are routing signals, not detection accuracy.
Combines quality signals into a complexity score, then chooses full-frame, 768-tile or 640-tile processing using configured thresholds.
Creates an edge-complete overlapping tile grid. Overlap protects objects cut by tile boundaries but increases processed pixels.
Runs the selected detector once per chosen full frame or tile at batch one. This is normally the dominant compute cost.
Adds each tile's x/y origin to local boxes, restoring every prediction to the original full-frame coordinate system.
Applies class-wise non-maximum suppression across all slices to remove duplicate boxes that overlap in neighbouring tiles.
Calculates class, confidence, size, density, spatial, workload and NMS statistics; video additionally reports sampling and track estimates.
Draws labels and boxes for images or optional video. Report-only video can omit expensive frame drawing and MP4 encoding.
Creates a standalone HTML evidence report that documents configuration, outputs, timing and interpretation boundaries.
Saves the annotated image when applicable, evidence JSON, video detection CSV and report. Source uploads are removed by edge policy.
Closes the reproducible execution trail and exposes only the output files produced by the selected policy.