ariankhalfani commited on
Commit
9db446f
1 Parent(s): 53eb3b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -58,11 +58,11 @@ def predict_image(input_image, name, age, medical_record, sex):
58
  # Determine the label based on the class index
59
  class_index = highest_confidence_result.cls.item()
60
  if class_index == 0:
61
- label = "Mature"
62
- color = (255, 0, 0) # Red for Mature
63
- else:
64
  label = "Normal"
65
  color = (0, 255, 0) # Green for Normal
 
 
 
66
 
67
  confidence = highest_confidence_result.conf.item()
68
  xmin, ymin, xmax, ymax = map(int, highest_confidence_result.xyxy[0])
 
58
  # Determine the label based on the class index
59
  class_index = highest_confidence_result.cls.item()
60
  if class_index == 0:
 
 
 
61
  label = "Normal"
62
  color = (0, 255, 0) # Green for Normal
63
+ elif class_index == 1:
64
+ label = "Cataract"
65
+ color = (255, 0, 0) # Red for Cataract
66
 
67
  confidence = highest_confidence_result.conf.item()
68
  xmin, ymin, xmax, ymax = map(int, highest_confidence_result.xyxy[0])