Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -323,7 +323,10 @@ if uploaded_image and query:
323
  for class_name, confidence in predictions:
324
  if int(confidence) > 0.05:
325
  fpredictions += f"{class_name}: {confidence:.2f}%,"
326
- st.write(f"{class_name}: {confidence:.2f}%")
 
 
 
327
  print(fpredictions)
328
 
329
  # call openai to pick the best classification result based on query
@@ -372,7 +375,10 @@ elif uploaded_image is not None:
372
  for class_name, confidence in predictions:
373
  if int(confidence) > 0.05:
374
  fpredictions += f"{class_name}: {confidence:.2f}%,"
375
- st.write(f"{class_name}: {confidence:.2f}%")
 
 
 
376
  print(fpredictions)
377
 
378
  elif query:
 
323
  for class_name, confidence in predictions:
324
  if int(confidence) > 0.05:
325
  fpredictions += f"{class_name}: {confidence:.2f}%,"
326
+ if int(confidence) > 5:
327
+ class_name = class_name.replace("_", " ")
328
+ class_name = class_name.title()
329
+ st.write(f"{class_name}: {confidence:.2f}%")
330
  print(fpredictions)
331
 
332
  # call openai to pick the best classification result based on query
 
375
  for class_name, confidence in predictions:
376
  if int(confidence) > 0.05:
377
  fpredictions += f"{class_name}: {confidence:.2f}%,"
378
+ if int(confidence) > 5:
379
+ class_name = class_name.replace("_", " ")
380
+ class_name = class_name.title()
381
+ st.write(f"{class_name}: {confidence:.2f}%")
382
  print(fpredictions)
383
 
384
  elif query: