Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ from diffusers import DiffusionPipeline
|
|
9 |
from huggingface_hub import login
|
10 |
import numpy as np
|
11 |
|
12 |
-
def guessanImage(image):
|
13 |
-
model = "microsoft/resnet-50"
|
14 |
# st.write("using model:"+model)
|
15 |
|
16 |
imgclassifier = pipeline("image-classification", model=model)
|
@@ -18,9 +18,11 @@ def guessanImage(image):
|
|
18 |
description = imgclassifier(image)
|
19 |
return description
|
20 |
|
|
|
|
|
21 |
demo = gr.Interface(
|
22 |
fn=guessanImage,
|
23 |
-
inputs=[gr.Image(type="pil")],
|
24 |
outputs=["text"],
|
25 |
)
|
26 |
|
|
|
9 |
from huggingface_hub import login
|
10 |
import numpy as np
|
11 |
|
12 |
+
def guessanImage(image, model):
|
13 |
+
#model = "microsoft/resnet-50"
|
14 |
# st.write("using model:"+model)
|
15 |
|
16 |
imgclassifier = pipeline("image-classification", model=model)
|
|
|
18 |
description = imgclassifier(image)
|
19 |
return description
|
20 |
|
21 |
+
radio = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier?"),
|
22 |
+
|
23 |
demo = gr.Interface(
|
24 |
fn=guessanImage,
|
25 |
+
inputs=[gr.Image(type="pil"), radio],
|
26 |
outputs=["text"],
|
27 |
)
|
28 |
|