refactor: single predict.py entrypoint (production + CLI), archive experiments
ci / smoke (push) Canceled after 0s
ci / smoke (push) Canceled after 0s
This commit is contained in:
1 parent
beb9c9fb6b
commit
52d3127302
36 files changed
+161
-48
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import cv2
|
||||
import sys
|
||||
|
||||
def main():
|
||||
source = "2026-07-27 09-11-50.mp4"
|
||||
if len(sys.argv) > 1:
|
||||
source = sys.argv[1]
|
||||
|
||||
print(f"Connecting to: {source}")
|
||||
cap = cv2.VideoCapture(source)
|
||||
if not cap.isOpened():
|
||||
print("Error: Could not open source!")
|
||||
return
|
||||
|
||||
# Read a few frames to let the camera stabilize exposure/stream
|
||||
print("Reading frames...")
|
||||
frame = None
|
||||
for i in range(10):
|
||||
ret, temp_frame = cap.read()
|
||||
if ret:
|
||||
frame = temp_frame
|
||||
|
||||
if frame is None:
|
||||
print("Error: Could not read any frame from the source!")
|
||||
cap.release()
|
||||
return
|
||||
|
||||
output_filename = "calib_frame.jpg"
|
||||
cv2.imwrite(output_filename, frame)
|
||||
print(f"Successfully saved clean frame as {output_filename}!")
|
||||
print(f"Resolution: {frame.shape[1]}x{frame.shape[0]}")
|
||||
cap.release()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user