Spaces:
Running
Running
App install correct
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
6 |
|
7 |
# Função de classificação
|
8 |
def predict_image(image):
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoModelForImageClassification, AutoFeatureExtractor, pipeline
|
3 |
|
4 |
+
model = AutoModelForImageClassification.from_pretrained("mestrevh/computer-vision-beans", use_safetensors=True)
|
5 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained("mestrevh/computer-vision-beans")
|
6 |
+
|
7 |
+
classifier = pipeline("image-classification", model=model, feature_extractor=feature_extractor)
|
8 |
|
9 |
# Função de classificação
|
10 |
def predict_image(image):
|