yuragoithf commited on
Commit
883b313
·
1 Parent(s): 4e2ea8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -44,13 +44,12 @@ def predict_class(image):
44
  # UI Design
45
  def classify_image(image):
46
  predicted_class = predict_class(image)
47
- output = f"<h2>Predicted Class:</h2><p>{predicted_class}</p>"
48
- return output
49
 
50
  inputs = gr.inputs.Image(label="Upload an image")
51
- outputs = gr.outputs.HTML()
52
 
53
- title = "<h1 style='text-align: center;'>Image Classifier</h1>"
54
  description = "Upload an image and get the predicted class."
55
 
56
- gr.Interface(fn=classify_image, inputs=inputs, outputs=outputs, title=title, description=description).launch()
 
44
  # UI Design
45
  def classify_image(image):
46
  predicted_class = predict_class(image)
47
+ return image, predicted_class
 
48
 
49
  inputs = gr.inputs.Image(label="Upload an image")
50
+ outputs = gr.outputs.Image(label="Uploaded Image"), gr.outputs.Textbox(label="Predicted Class", live=True)
51
 
52
+ title = "Image Classifier"
53
  description = "Upload an image and get the predicted class."
54
 
55
+ gr.Interface(fn=classify_image, inputs=inputs, outputs=outputs, title=title, description=description).launch(inline=True)