Add min_displacement_m camera filter to drop stationary-vehicle phantom tracks - #4
Merged
Merged
Conversation
…back, coralapi - Fix RoboflowInferenceDetector request format for Inference Server 1.x (model_id + image belong in the JSON body; the old query-param form gets HTTP 422, which previously surfaced as silent zero-detection results) - Add opt-in client-side downscaling (roboflow.resize_max_px / coralapi.resize_max_px): the server resizes to model input anyway, so smaller uploads cut per-frame latency 3-4x at identical accuracy; predictions are rescaled to original frame coordinates - Remote detectors now raise DetectorUnavailableError on transport failures instead of returning empty detections; new FallbackDetector optionally falls back to local CPU inference (detection_fallback: local) - immediate switch when the backend never succeeded this job, after 3 consecutive failures otherwise, sticky per job, local model loaded lazily - ProcessingResult now records detection_backend / detection_model / detection_fallback (what actually ran), surfaced in API responses and as backend/model/fallback tags on InfluxDB metrics for per-model dashboards and fallback-rate alerting - New coralapi backend (https://github.com/nathan-v/coralapi) for Coral Edge TPU inference: multipart /v1/vision/detect, normalized-box scaling, label mapping with COCO-90 index fallback for label-less models - Docs: backend comparison/config for coralapi, detection_fallback setting; gitignore local benchmark artifacts
…om tracks Parked vehicles with jittery bounding boxes fragment into short ByteTrack tracks whose small net displacement over a short window computes as a plausible 3-10 mph speed, polluting low-speed production data (confirmed against a week of InfluxDB points: sub-10 mph readings cluster at 10-40 detections vs ~60-250 for real traffic). A displacement floor separates the two cleanly: jitter fragments net a couple of meters at most, while genuine slow vehicles (parking maneuvers, garbage trucks) cover 20m+. Filtering on distance also avoids the false tradeoff of raising min_detections, which would drop legitimately fast vehicles that cross the zone in under 3 seconds. Default 0.0 (disabled) for backward compatibility; filtered tracks count toward vehicles_filtered as with the existing filters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
min_displacement_mcamera setting: a track must travel at least this many real-world meters (net, first-to-last smoothed position) to count as a vehicle. Filtered tracks incrementvehicles_filteredlike the existing filters. Default0.0(disabled) keeps existing behavior.Related Issue
N/A
Motivation and Context
Parked vehicles with jittery bounding boxes fragment into short ByteTrack tracks whose small net displacement over a short time window computes as a plausible 3-10 mph reading. Analysis of a week of production InfluxDB data confirmed the signature: sub-10 mph points cluster at 10-40 detections while real traffic runs ~60-250. A displacement floor separates phantom fragments (net movement of a couple meters) from genuine slow vehicles (parking maneuvers, garbage trucks covering 20m+), and unlike raising
min_detectionsit doesn't penalize fast vehicles that cross the zone in under 3 seconds.How Has This Been Tested?
Types of changes
Checklist:
ruff checkandruff formatpass)