Update object_detection.py
Browse files- object_detection.py +3 -3
object_detection.py
CHANGED
|
@@ -10,13 +10,13 @@ import time
|
|
| 10 |
# Method to detect objects with given confidence score
|
| 11 |
|
| 12 |
def detectObjects(imageFile, confidence_score):
|
| 13 |
-
|
| 14 |
-
print(f"Current working directory: {
|
| 15 |
# Load a pre-trained YOLOv8 model (e.g., YOLOv8n)
|
| 16 |
model = YOLO("yolov8n.pt", verbose=False) # Use other variants like yolov8s.pt for better accuracy
|
| 17 |
|
| 18 |
# Define a custom directory to save the results
|
| 19 |
-
custom_save_dir = f"
|
| 20 |
|
| 21 |
custom_read_dir = "./"
|
| 22 |
|
|
|
|
| 10 |
# Method to detect objects with given confidence score
|
| 11 |
|
| 12 |
def detectObjects(imageFile, confidence_score):
|
| 13 |
+
current_path = os.getcwd()
|
| 14 |
+
print(f"Current working directory: {current_path}")
|
| 15 |
# Load a pre-trained YOLOv8 model (e.g., YOLOv8n)
|
| 16 |
model = YOLO("yolov8n.pt", verbose=False) # Use other variants like yolov8s.pt for better accuracy
|
| 17 |
|
| 18 |
# Define a custom directory to save the results
|
| 19 |
+
custom_save_dir = f"{current_path}/runs/detect/predict"
|
| 20 |
|
| 21 |
custom_read_dir = "./"
|
| 22 |
|