Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,12 @@ import gradio as gr
|
|
2 |
import pandas as pd
|
3 |
from PIL import Image
|
4 |
from transformers import pipeline
|
5 |
-
|
|
|
6 |
|
7 |
def dog_classifier(dog_image):
|
8 |
image = Image.fromarray(dog_image)
|
9 |
-
|
10 |
-
dog_classifier = AutoModelForImageClassification.from_pretrained("raffaelsiregar/dog-breeds-classification")
|
11 |
-
output = dog_classifier(image)
|
12 |
|
13 |
# creating pandas dataframe
|
14 |
df = pd.DataFrame(output)
|
|
|
2 |
import pandas as pd
|
3 |
from PIL import Image
|
4 |
from transformers import pipeline
|
5 |
+
|
6 |
+
pipe = pipeline("image-classification", model="raffaelsiregar/dog-breeds-classification", use_auth_token=True)
|
7 |
|
8 |
def dog_classifier(dog_image):
|
9 |
image = Image.fromarray(dog_image)
|
10 |
+
output = pipe(image)
|
|
|
|
|
11 |
|
12 |
# creating pandas dataframe
|
13 |
df = pd.DataFrame(output)
|