phase 4
This commit is contained in:
34
tests/detect/manual/test_frame_extractor_e2e.py
Normal file
34
tests/detect/manual/test_frame_extractor_e2e.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
End-to-end test: run FrameExtractor and verify SSE events are emitted.
|
||||
|
||||
Usage:
|
||||
python tests/detect/manual/test_frame_extractor_e2e.py
|
||||
|
||||
Requires Redis running. Events appear at: http://mpr.local.ar/detection/?job=e2e-test
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, ".")
|
||||
|
||||
from detect.profiles.soccer import SoccerBroadcastProfile
|
||||
from detect.stages.frame_extractor import extract_frames
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
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
|
||||
|
||||
logger.info("Extracting frames from %s (fps=%s, max=%d)", VIDEO, config.fps, config.max_frames)
|
||||
logger.info("Open: http://mpr.local.ar/detection/?job=%s", JOB_ID)
|
||||
input("\nPress Enter to start...")
|
||||
|
||||
frames = extract_frames(VIDEO, config, job_id=JOB_ID)
|
||||
logger.info("Done: %d frames extracted", len(frames))
|
||||
logger.info("Open http://mpr.local.ar/detection/?job=%s to see the events", JOB_ID)
|
||||
Reference in New Issue
Block a user