mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 22:06:32 +00:00
2.6 KiB
2.6 KiB
Acceptance Criteria
Detection Accuracy
- Detections with confidence below
probability_threshold(default: 0.25) are filtered out. - Overlapping detections with containment ratio >
tracking_intersection_threshold(default: 0.6) are deduplicated, keeping the higher-confidence detection. - Tile duplicate detections are identified when all bounding box coordinates differ by less than 0.01 (TILE_DUPLICATE_CONFIDENCE_THRESHOLD).
- Physical size filtering: detections exceeding
max_object_size_metersfor their class (defined in classes.json, range 2–20 meters) are removed.
Video Processing
- Frame sampling: every Nth frame processed, controlled by
frame_period_recognition(default: 4). - Minimum annotation interval:
frame_recognition_seconds(default: 2 seconds) between reported annotations. - Tracking: new annotation accepted if any detection moved beyond
tracking_distance_confidencethreshold or confidence increased beyondtracking_probability_increase.
Image Processing
- Images ≤ 1.5× model dimensions (1280×1280): processed as single frame.
- Larger images: tiled based on ground sampling distance. Tile physical size: 25 meters (METERS_IN_TILE). Tile overlap:
big_image_tile_overlap_percent(default: 20%). - GSD calculation:
sensor_width * altitude / (focal_length * image_width).
API
GET /healthalways returnsstatus: "healthy"(even if engine is unavailable — aiAvailability indicates actual state).POST /detectreturns detection results synchronously. Errors: 400 (empty/invalid image), 422 (runtime error), 503 (engine unavailable).POST /detect/{media_id}returns immediately with{"status": "started"}. Rejects duplicate media_id with 409.GET /detect/streamdelivers SSE events withmediaStatusvalues: AIProcessing, AIProcessed, Error.- SSE queue maximum depth: 100 events per client. Overflow is silently dropped.
Engine Lifecycle
- Engine initialization is lazy (first detection request, not startup).
- Status transitions: NONE → DOWNLOADING → (CONVERTING → UPLOADING →) ENABLED | WARNING | ERROR.
- GPU check: NVIDIA GPU with compute capability ≥ 6.1.
- TensorRT conversion uses FP16 precision when GPU supports fast FP16.
- Background conversion does not block API responsiveness.
Logging
- Log files:
Logs/log_inference_YYYYMMDD.txt. - Rotation: daily.
- Retention: 30 days.
- Console: INFO/DEBUG/SUCCESS to stdout, WARNING+ to stderr.
Object Classes
- 19 base detection classes defined in
classes.json. - 3 weather modes (Norm, Wint, Night) — total up to 57 class variants.
- Each class has: Id, Name, Color, MaxSizeM (max physical size in meters).