Spaces:
Sleeping
Sleeping
Navy
commited on
Commit
·
6d007bb
1
Parent(s):
1108adc
last update
Browse files
core/defect_detection_image.py
CHANGED
|
@@ -91,12 +91,12 @@ def detect_defect_from_base64(station_id: str, camera_id: str, image_base64: str
|
|
| 91 |
frame_base64 = base64.b64encode(buffer).decode("utf-8")
|
| 92 |
|
| 93 |
# Save OK image (no bbox)
|
| 94 |
-
output_dir = "outputs/images"
|
| 95 |
-
os.makedirs(output_dir, exist_ok=True)
|
| 96 |
-
filename = f"{station_id}_{camera_id}_OK_{datetime.now().strftime('%Y%m%d_%H%M%S')}.jpg"
|
| 97 |
-
filepath = os.path.join(output_dir, filename)
|
| 98 |
-
cv2.imwrite(filepath, frame)
|
| 99 |
-
logger.info(f"[SAVED] OK image saved to {filepath}")
|
| 100 |
|
| 101 |
if detections:
|
| 102 |
logger.info(f"[DETECTED] Camera {camera_id} → {len(detections)} defect(s)")
|
|
|
|
| 91 |
frame_base64 = base64.b64encode(buffer).decode("utf-8")
|
| 92 |
|
| 93 |
# Save OK image (no bbox)
|
| 94 |
+
# output_dir = "outputs/images"
|
| 95 |
+
# os.makedirs(output_dir, exist_ok=True)
|
| 96 |
+
# filename = f"{station_id}_{camera_id}_OK_{datetime.now().strftime('%Y%m%d_%H%M%S')}.jpg"
|
| 97 |
+
# filepath = os.path.join(output_dir, filename)
|
| 98 |
+
# cv2.imwrite(filepath, frame)
|
| 99 |
+
# logger.info(f"[SAVED] OK image saved to {filepath}")
|
| 100 |
|
| 101 |
if detections:
|
| 102 |
logger.info(f"[DETECTED] Camera {camera_id} → {len(detections)} defect(s)")
|