Last Stable Version
Collection
siglip2
β’
1 item
β’
Updated
appy-monkey-local-96.07is a vision-language encoder model fine-tuned fromsiglip2-base-patch16-224for binary image classification. The model is built for game content moderation, distinguishing between safe (good) and unsafe (bad) visual content. It leverages theSiglipForImageClassificationarchitecture for effective visual understanding.
SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features https://arxiv.org/pdf/2502.14786
Classification Report:
precision recall f1-score support
bad 0.9814 0.9339 0.9571 1755
good 0.9439 0.9844 0.9637 1983
Accuracy: 0.9607
F1 Score: 0.9604
Class 0: bad (Unsafe content)
Class 1: good (Safe content)
pip install -q transformers torch pillow gradio hf_xet
import gradio as gr
from transformers import AutoImageProcessor, SiglipForImageClassification
from PIL import Image
import torch
# Load model and processor
model_name = "prithivMLmods/appy-monkey-local-96.07" # Update with the actual model repo if needed
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)
# Binary label mapping
id2label = {
"0": "bad", # Unsafe content
"1": "good" # Safe content
}
def classify_image(image):
image = Image.fromarray(image).convert("RGB")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
prediction = {
id2label[str(i)]: round(probs[i], 3) for i in range(len(probs))
}
return prediction
# Gradio Interface
iface = gr.Interface(
fn=classify_image,
inputs=gr.Image(type="numpy"),
outputs=gr.Label(num_top_classes=2, label="Game Content Moderation"),
title="Appy-Monkey: Game Content Classifier",
description="Upload a game image or screenshot to classify whether the content is Safe (good) or Unsafe (bad)."
)
if __name__ == "__main__":
iface.launch()
appy-monkey-local-96.07 is designed for:
Base model
google/siglip2-base-patch16-224