Spaces:
Sleeping
Sleeping
Download test_simple.py from rajesh9698/all: direct link, hf CLI and curl.
- Browser
- Download file 615 Bytes
-
https://huggingface.co/spaces/rajesh9698/all/resolve/main/test_simple.py
- Command line
-
hf download hf://spaces/rajesh9698/all/test_simple.py
-
curl -L -o test_simple.py https://huggingface.co/spaces/rajesh9698/all/resolve/main/test_simple.py
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() | |