28 lines
898 B
Python
28 lines
898 B
Python
"""
|
|
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")
|