Spaces:
Running
on
Zero
Running
on
Zero
Update object_extractor.py
Browse files- object_extractor.py +8 -9
object_extractor.py
CHANGED
|
@@ -3,7 +3,6 @@ import logging
|
|
| 3 |
import traceback
|
| 4 |
from typing import Dict, List, Any, Optional
|
| 5 |
|
| 6 |
-
# 設置日誌記錄器
|
| 7 |
logger = logging.getLogger(__name__)
|
| 8 |
|
| 9 |
class ObjectExtractor:
|
|
@@ -158,14 +157,14 @@ class ObjectExtractor:
|
|
| 158 |
|
| 159 |
logger.info(f"Extracted {len(detected_objects)} objects from detection result")
|
| 160 |
|
| 161 |
-
print(f"DEBUG: ObjectExtractor filtered objects by class:")
|
| 162 |
-
for class_name in ["car", "traffic light", "person", "handbag"]:
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
print(f"DEBUG: base_conf_threshold: {self.base_conf_threshold}")
|
| 168 |
-
print(f"DEBUG: dynamic_conf_map: {self.dynamic_conf_map}")
|
| 169 |
|
| 170 |
return detected_objects
|
| 171 |
|
|
|
|
| 3 |
import traceback
|
| 4 |
from typing import Dict, List, Any, Optional
|
| 5 |
|
|
|
|
| 6 |
logger = logging.getLogger(__name__)
|
| 7 |
|
| 8 |
class ObjectExtractor:
|
|
|
|
| 157 |
|
| 158 |
logger.info(f"Extracted {len(detected_objects)} objects from detection result")
|
| 159 |
|
| 160 |
+
# print(f"DEBUG: ObjectExtractor filtered objects by class:")
|
| 161 |
+
# for class_name in ["car", "traffic light", "person", "handbag"]:
|
| 162 |
+
# class_objects = [obj for obj in detected_objects if obj.get("class_name") == class_name]
|
| 163 |
+
# if class_objects:
|
| 164 |
+
# confidences = [obj.get("confidence", 0) for obj in class_objects]
|
| 165 |
+
# print(f"DEBUG: {class_name}: {len(class_objects)} objects, confidences: {confidences}")
|
| 166 |
+
# print(f"DEBUG: base_conf_threshold: {self.base_conf_threshold}")
|
| 167 |
+
# print(f"DEBUG: dynamic_conf_map: {self.dynamic_conf_map}")
|
| 168 |
|
| 169 |
return detected_objects
|
| 170 |
|