manavshekar3340 commited on
Commit
7d5380c
·
verified ·
1 Parent(s): 8c16b2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -1,3 +1,20 @@
1
  import gradio as gr
2
 
3
- gr.load("models/dima806/indian_food_image_detection").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ # Load the pre-trained model from Hugging Face
4
+ model = gr.load("models/dima806/indian_food_image_detection")
5
+
6
+ # Create a function to classify images using the loaded model
7
+ def classify_image(image):
8
+ return model(image)
9
+
10
+ # Create a Gradio interface with a custom title
11
+ iface = gr.Interface(
12
+ fn=classify_image,
13
+ inputs=gr.Image(type="numpy", label="Upload an image"),
14
+ outputs=gr.Label(label="Prediction"),
15
+ title="CAPSTONE",
16
+ description="Upload an image of Indian food to detect what it is."
17
+ )
18
+
19
+ # Launch the Gradio interface
20
+ iface.launch()