brxerq commited on
Commit
6ceb078
·
verified ·
1 Parent(s): f7db520

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -2,7 +2,6 @@
2
  import gradio as gr
3
  import numpy as np
4
  import tensorflow as tf
5
- import tensorflow_hub as hub
6
  import cv2
7
 
8
  # Load class labels from the text file
@@ -37,9 +36,9 @@ def predict_image(image):
37
  label = train_info[top_class] # Get the corresponding label
38
  return label
39
 
40
- # Define the Gradio interface
41
- input_image = gr.inputs.Image(shape=(224, 224))
42
- output_label = gr.outputs.Label()
43
 
44
  # Launch the Gradio interface
45
  gr.Interface(fn=predict_image, inputs=input_image, outputs=output_label, capture_session=True).launch()
 
2
  import gradio as gr
3
  import numpy as np
4
  import tensorflow as tf
 
5
  import cv2
6
 
7
  # Load class labels from the text file
 
36
  label = train_info[top_class] # Get the corresponding label
37
  return label
38
 
39
+ # Updated Gradio interface
40
+ input_image = gr.Image(shape=(224, 224))
41
+ output_label = gr.Label()
42
 
43
  # Launch the Gradio interface
44
  gr.Interface(fn=predict_image, inputs=input_image, outputs=output_label, capture_session=True).launch()