Komal133 commited on
Commit
e7d22a5
·
verified ·
1 Parent(s): 148138d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- current_date = datetime.now().strftime("%Y-%m-d")
 
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) # Removed the unsupported allow_flagging parameter
 
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)