import gradio as gr
from transformers import pipeline
classifier = pipeline("image-classification", model="TPM-28/MemeDetector")
def classify_image(image):
predictions = classifier(image)
result = {pred['label']: pred['score'] for pred in predictions}
return result
interface = gr.Interface(
fn=classify_image,
inputs=gr.Image(type="pil"),
outputs=gr.Label(num_top_classes=3),
title="Meme Detector"
)
if __name__ == "__main__":
interface.launch()
- Downloads last month
- 6
Model tree for TPM-28/MemeDetector
Base model
google/vit-base-patch16-224