Update handlers/frame_handler_yolo.py
Browse files
handlers/frame_handler_yolo.py
CHANGED
|
@@ -68,7 +68,7 @@ def extract_key_frames(input_folder, key_frames_folder, original_fps, model_path
|
|
| 68 |
if counter % 1000 == 0:
|
| 69 |
print(f"Processed {counter} frames.")
|
| 70 |
# Run YOLO inference
|
| 71 |
-
results = model.predict(frame, conf=0.
|
| 72 |
|
| 73 |
# Check if a football (sports ball) is detected
|
| 74 |
ball_detected = any(model.names[int(box.cls)] == "sports ball" for box in results[0].boxes)
|
|
@@ -145,7 +145,7 @@ def crop_preserve_key_objects(input_folder, output_folder, model_path='yolov8n.p
|
|
| 145 |
new_height = int(original_width / target_aspect_ratio)
|
| 146 |
|
| 147 |
# YOLO inference
|
| 148 |
-
results = model.predict(frame, conf=0.
|
| 149 |
|
| 150 |
# Initialize variables
|
| 151 |
ball_detected = False
|
|
|
|
| 68 |
if counter % 1000 == 0:
|
| 69 |
print(f"Processed {counter} frames.")
|
| 70 |
# Run YOLO inference
|
| 71 |
+
results = model.predict(frame, conf=0.1, verbose=False)
|
| 72 |
|
| 73 |
# Check if a football (sports ball) is detected
|
| 74 |
ball_detected = any(model.names[int(box.cls)] == "sports ball" for box in results[0].boxes)
|
|
|
|
| 145 |
new_height = int(original_width / target_aspect_ratio)
|
| 146 |
|
| 147 |
# YOLO inference
|
| 148 |
+
results = model.predict(frame, conf=0.1, verbose=False)
|
| 149 |
|
| 150 |
# Initialize variables
|
| 151 |
ball_detected = False
|