Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def load_image(image_url, image_size=256, dynamic_size=False, max_dynamic_size=5
|
|
57 |
image_size = 224
|
58 |
dynamic_size = False
|
59 |
|
60 |
-
model_name = "efficientnetv2-
|
61 |
|
62 |
model_handle_map = {
|
63 |
"efficientnetv2-s": "https://tfhub.dev/google/imagenet/efficientnet_v2_imagenet1k_s/classification/2",
|
@@ -214,5 +214,9 @@ def inference(img):
|
|
214 |
line = f'({i+1}) {class_index:4} - {classes[class_index]}: {probabilities[0][top_5][i]}'
|
215 |
result[classes[class_index]] = probabilities[0][top_5][i].item()
|
216 |
return result
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
57 |
image_size = 224
|
58 |
dynamic_size = False
|
59 |
|
60 |
+
model_name = "efficientnetv2-b0"
|
61 |
|
62 |
model_handle_map = {
|
63 |
"efficientnetv2-s": "https://tfhub.dev/google/imagenet/efficientnet_v2_imagenet1k_s/classification/2",
|
|
|
214 |
line = f'({i+1}) {class_index:4} - {classes[class_index]}: {probabilities[0][top_5][i]}'
|
215 |
result[classes[class_index]] = probabilities[0][top_5][i].item()
|
216 |
return result
|
217 |
+
|
218 |
+
title="efficientnet_v2_imagenet1k_b0"
|
219 |
+
description="Gradio Demo for efficientnet_v2_imagenet1k_b0: Imagenet (ILSVRC-2012-CLS) classification with EfficientNet V2 with input size 224x224. To use it, simply upload your image or click on one of the examples to load them. Read more at the links below"
|
220 |
+
article = "<p style='text-align: center'><a href='https://tfhub.dev/google/imagenet/efficientnet_v2_imagenet1k_b0/classification/2' target='_blank'>Tensorflow Hub</a></p>"
|
221 |
+
examples=[['turtle.jpeg']]
|
222 |
+
gr.Interface(inference,gr.inputs.Image(type="filepath"),"label",title=title,description=description,article=article,examples=examples).launch(enable_queue=True)
|