Gender-Classifier-Mini
is an image classification vision-language encoder model fine-tuned from
google/siglip2-base-patch16-224
for a single-label classification task. It is designed to classify images based on gender using the
SiglipForImageClassification
architecture.
Accuracy: 0.9720
F1 Score: 0.9720
Classification Report:
precision recall f1-score support
Female ♀ 0.96600.97960.97272549
Male ♂ 0.97850.96410.97122451
accuracy 0.97205000
macro avg 0.97220.97180.97205000
weighted avg 0.97210.97200.97205000
The model categorizes images into two classes:
Class 0:
"Female ♀"
Class 1:
"Male ♂"
Run with Transformers🤗
!pip install -q transformers torch pillow gradio
import gradio as gr
from transformers import AutoImageProcessor
from transformers import SiglipForImageClassification
from transformers.image_utils import load_image
from PIL import Image
import torch
# Load model and processor
model_name = "prithivMLmods/Gender-Classifier-Mini"
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)
defgender_classification(image):
"""Predicts gender category for an 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()
labels = {"0": "Female ♀", "1": "Male ♂"}
predictions = {labels[str(i)]: round(probs[i], 3) for i inrange(len(probs))}
return predictions
# Create Gradio interface
iface = gr.Interface(
fn=gender_classification,
inputs=gr.Image(type="numpy"),
outputs=gr.Label(label="Prediction Scores"),
title="Gender Classification",
description="Upload an image to classify its gender."
)
# Launch the appif __name__ == "__main__":
iface.launch()
Intended Use:
The
Gender-Classifier-Mini
model is designed to classify images into gender categories. Potential use cases include:
Demographic Analysis:
Assisting in understanding gender distribution in datasets.
Face Recognition Systems:
Enhancing identity verification processes.
Marketing & Advertising:
Personalizing content based on demographic insights.
Healthcare & Research:
Supporting gender-based analysis in medical imaging.
Runs of prithivMLmods Gender-Classifier-Mini on huggingface.co
1.9K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About Gender-Classifier-Mini huggingface.co Model
Gender-Classifier-Mini huggingface.co is an AI model on huggingface.co that provides Gender-Classifier-Mini's model effect (), which can be used instantly with this prithivMLmods Gender-Classifier-Mini model. huggingface.co supports a free trial of the Gender-Classifier-Mini model, and also provides paid use of the Gender-Classifier-Mini. Support call Gender-Classifier-Mini model through api, including Node.js, Python, http.
Gender-Classifier-Mini huggingface.co is an online trial and call api platform, which integrates Gender-Classifier-Mini's modeling effects, including api services, and provides a free online trial of Gender-Classifier-Mini, you can try Gender-Classifier-Mini online for free by clicking the link below.
prithivMLmods Gender-Classifier-Mini online free url in huggingface.co:
Gender-Classifier-Mini is an open source model from GitHub that offers a free installation service, and any user can find Gender-Classifier-Mini on GitHub to install. At the same time, huggingface.co provides the effect of Gender-Classifier-Mini install, users can directly use Gender-Classifier-Mini installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Gender-Classifier-Mini install url in huggingface.co: