Update app.py
Browse files
app.py
CHANGED
|
@@ -149,7 +149,8 @@ def detect_defects(image):
|
|
| 149 |
draw.text((box[0], box[1] - 20 if box[1] > 20 else box[1],), text, fill="red", font=font)
|
| 150 |
|
| 151 |
if output:
|
| 152 |
-
|
|
|
|
| 153 |
inspection_name = f"Inspection-{current_date}-{len(output):03d}"
|
| 154 |
|
| 155 |
try:
|
|
@@ -228,4 +229,4 @@ with gr.Blocks() as demo:
|
|
| 228 |
)
|
| 229 |
|
| 230 |
if __name__ == "__main__":
|
| 231 |
-
demo.launch(share=False)
|
|
|
|
| 149 |
draw.text((box[0], box[1] - 20 if box[1] > 20 else box[1],), text, fill="red", font=font)
|
| 150 |
|
| 151 |
if output:
|
| 152 |
+
# Fixed date formatting to ensure proper YYYY-MM-DD format
|
| 153 |
+
current_date = datetime.now().strftime("%Y-%m-%d")
|
| 154 |
inspection_name = f"Inspection-{current_date}-{len(output):03d}"
|
| 155 |
|
| 156 |
try:
|
|
|
|
| 229 |
)
|
| 230 |
|
| 231 |
if __name__ == "__main__":
|
| 232 |
+
demo.launch(share=False)
|