all / test_simple.py
rajesh9698's picture
Deploy: test_simple.py
8742183 verified
Raw History Blame Contribute Delete
615 Bytes
import cv2
import os
from detector import engine
# Find any temp video
videos = [f for f in os.listdir("backend") if f.startswith("temp_") and f.endswith(".mp4")]
if not videos:
print("No temp videos found.")
else:
test_vid = os.path.join("backend", videos[0])
print(f"Testing {test_vid}...")
cap = cv2.VideoCapture(test_vid)
for i in range(5):
ret, frame = cap.read()
if not ret: break
annotated, total, occupied, free, slots = engine.process_frame(frame)
print(f"Frame {i}: Occupied={occupied}/{total}, Slots={len(slots)}")
cap.release()