DHEIVER commited on
Commit
907b41c
1 Parent(s): 73036df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -17,24 +17,17 @@ def classify_image(input_image):
17
 
18
  # Assuming your model outputs probabilities for two classes, you can return the class with the highest probability
19
  class_index = np.argmax(prediction)
20
- class_labels = ["Class 0", "Class 1"] # Replace with your actual class labels
21
  predicted_class = class_labels[class_index]
22
 
23
  return predicted_class
24
 
25
  # Create a Gradio interface
26
- input_interface = gr.inputs.Image() # Gradio input component for image
27
- output_interface = gr.outputs.Text() # Gradio output component for text
28
-
29
- # Create the Gradio app
30
- app = gr.Interface(
31
  fn=classify_image,
32
- inputs=input_interface,
33
- outputs=output_interface,
34
- live=True,
35
- title="Image Classifier",
36
- description="Classify images using a trained model."
37
  )
38
 
39
- # Start the Gradio app
40
- app.launch()
 
17
 
18
  # Assuming your model outputs probabilities for two classes, you can return the class with the highest probability
19
  class_index = np.argmax(prediction)
20
+ class_labels = ["Normal", "Cataract"] # Replace with your actual class labels
21
  predicted_class = class_labels[class_index]
22
 
23
  return predicted_class
24
 
25
  # Create a Gradio interface
26
+ input_interface = gr.Interface(
 
 
 
 
27
  fn=classify_image,
28
+ inputs="image", # Specify input type as "image"
29
+ outputs="text" # Specify output type as "text"
 
 
 
30
  )
31
 
32
+ # Launch the Gradio app
33
+ input_interface.launch()