phase 3
This commit is contained in:
27
tests/detect/test_frame_extractor_e2e.py
Normal file
27
tests/detect/test_frame_extractor_e2e.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
End-to-end test: run FrameExtractor and verify SSE events are emitted.
|
||||
|
||||
Usage (manual):
|
||||
python tests/detect/test_frame_extractor_e2e.py
|
||||
|
||||
Requires Redis running on localhost:6381.
|
||||
Push events will appear at: http://mpr.local.ar/detection/?job=e2e-test
|
||||
"""
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, ".")
|
||||
|
||||
from detect.profiles.soccer import SoccerBroadcastProfile
|
||||
from detect.stages.frame_extractor import extract_frames
|
||||
|
||||
VIDEO = "media/out/chunks/95043d50-4df6-4ac8-bbd5-2ba873117c6e/chunk_0000.mp4"
|
||||
JOB_ID = "e2e-test"
|
||||
|
||||
profile = SoccerBroadcastProfile()
|
||||
config = profile.frame_extraction_config()
|
||||
config.max_frames = 20 # keep it quick
|
||||
|
||||
print(f"Extracting frames from {VIDEO} (fps={config.fps}, max={config.max_frames})")
|
||||
frames = extract_frames(VIDEO, config, job_id=JOB_ID)
|
||||
print(f"Done: {len(frames)} frames extracted")
|
||||
print(f"Open http://mpr.local.ar/detection/?job={JOB_ID} to see the events")
|
||||
Reference in New Issue
Block a user