1.png

Graphic-Class

Graphic-Class is a vision model fine-tuned from google/siglip2-base-patch16-224 for graphic content moderation. It uses the SiglipForImageClassification architecture to classify graphical images (such as UI designs, 2D game assets, digital art) into safe or problematic categories.


Label Space: 2 Classes

The model classifies each image into one of the following categories:

0: bad
1: good
  • bad: images with bad symbols, inappropriate or offensive text, broken UI/UX elements, distorted or harmful designs.
  • good: plain, safe, or character-rich graphics, such as 2D game elements, educational visuals, or well-structured UI components.

Install Dependencies

pip install -q transformers torch pillow gradio

Inference Code

import gradio as gr
from transformers import AutoImageProcessor, SiglipForImageClassification
from PIL import Image
import torch

# Load model and processor
model_name = "prithivMLmods/Graphic-Class"  # Replace with your model path if different
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)

# Label mapping
id2label = {
    "0": "bad",
    "1": "good"
}

def classify_graphic(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_graphic,
    inputs=gr.Image(type="numpy"),
    outputs=gr.Label(num_top_classes=2, label="Graphic Content Classification"),
    title="Graphic-Class",
    description="Upload a graphic or design asset to classify it as 'good' or 'bad'."
)

if __name__ == "__main__":
    iface.launch()

Intended Use

Graphic-Class can be used for:

  • Graphic Content Moderation โ€“ Automatically filter unsafe or visually inappropriate designs in creative pipelines.
  • Game Asset Filtering โ€“ Evaluate textures, objects, or sprites for suitability in game environments.
  • UI/UX Quality Control โ€“ Detect broken or low-quality interface components in design feedback loops.
  • Educational & Kids App Filtering โ€“ Ensure graphics meet safety and design standards for children's content.
Downloads last month
49
Safetensors
Model size
92.9M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for prithivMLmods/Graphic-Class

Finetuned
(99)
this model