mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 22:26:33 +00:00
be4cab4fcb
- Added `/detect/video` endpoint for true streaming video detection, allowing inference to start as upload bytes arrive. - Introduced `run_detect_video_stream` method in the inference module to handle video processing from a file-like object. - Updated media hashing to include a new function for computing hashes directly from files with minimal I/O. - Enhanced documentation to reflect changes in video processing and API behavior. Made-with: Cursor
1.0 KiB
1.0 KiB
Implementation Report — Video Pre-Write Removal
Date: 2026-04-01 Tasks: 1 Batches: 1 Total Complexity: 2 points
Summary
Removed redundant synchronous video pre-writes in the /detect endpoint. Videos are now written to disk exactly once by inference.pyx's background writer thread, concurrently with frame detection.
Tasks Completed
| Task | Name | Complexity | Status |
|---|---|---|---|
| AZ-177 | remove_redundant_video_prewrite | 2 | Done |
Changes
| File | Change |
|---|---|
| src/main.py | Auth'd path: wrap file write with if kind == "image" so videos skip pre-write |
| src/main.py | Non-auth'd path: remove open().write() after mkstemp — inference handles the write |
Test Results
18/18 tests passed. 4 new tests added:
test_auth_video_storage_path_opened_wb_oncetest_non_auth_temp_video_opened_wb_once_and_removedtest_auth_image_still_writes_once_before_detecttest_video_writer_runs_in_separate_thread_from_executor