Spaces:
Sleeping
Sleeping
File size: 519 Bytes
de248c7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from transformers import pipeline
# Load model from Hugging Face Hub
model_pipeline = pipeline("image-classification", model="opria123/detr-resnet-50-dc5-hardhat-finetuned")
def classify_image(image):
return model_pipeline(image)
# Create a Gradio interface
demo = gr.Interface(
fn=classify_image,
inputs=gr.Image(type="pil"),
outputs=gr.Label(num_top_classes=3),
title="Image Classifier",
description="Upload an image to see the classification results."
)
demo.launch()
|