Spaces:
Runtime error
Runtime error
2line ex
Browse files- app.py +11 -0
- data/aki_dog.jpg +0 -0
- data/wonder_cat.jpg +0 -0
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
vision_classifier = pipeline(task="image-classification",
|
5 |
+
model="microsoft/beit-base-patch16-224-pt22k-ft22k")
|
6 |
+
iface = gr.Interface.from_pipeline(vision_classifier,
|
7 |
+
title="2-line Object Recognition using HF Pipeline",
|
8 |
+
description="Demonstrates how to use a pipeline and model hub.",
|
9 |
+
examples=['data/wonder_cat.jpg', 'data/aki_dog.jpg',]
|
10 |
+
article = "Author: <a href=\"https://huggingface.co/rowel\">Rowel Atienza</a>",
|
11 |
+
).launch()
|
data/aki_dog.jpg
ADDED
data/wonder_cat.jpg
ADDED