Runs YOLO model on the image and returns True if an object is detected.
(image)
| 712 | |
| 713 | |
| 714 | def detect_objects(image): |
| 715 | """Runs YOLO model on the image and returns True if an object is detected.""" |
| 716 | results = model(image) |
| 717 | for result in results: |
| 718 | if len(result.boxes) > 0: |
| 719 | return True # At least one object detected |
| 720 | return False |
| 721 | |
| 722 | |
| 723 | def enhance_image_for_ocr(image): |