AZIIIIIIIIZ's picture
Upload app.py
7cc417d verified
raw
history blame
No virus
923 Bytes
# import gradio as gr
# demo = gr.load("AZIIIIIIIIZ/vit-base-patch16-224-finetuned-eurosat", src="models")
# demo.launch()
###########################33
import gradio as gr
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="AZIIIIIIIIZ/vit-base-patch16-224-finetuned-eurosat")
# Use a pipeline as a high-level helper
# Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("AZIIIIIIIIZ/vit-base-patch16-224-finetuned-eurosat")
model = AutoModelForImageClassification.from_pretrained("AZIIIIIIIIZ/vit-base-patch16-224-finetuned-eurosat")
def predict(image):
return pipe(image)
demo = gr.Interface(
fn=predict,
inputs='image',
outputs='text',
)
demo.launch()
# $ pip install gradio_client fastapi uvicorn