Run this model with HF Jobs
Run prithivMLmods/MetaCLIP-2-Gender-Identifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/prithivMLmods/MetaCLIP-2-Gender-Identifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/prithivMLmods/MetaCLIP-2-Gender-Identifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use prithivMLmods/MetaCLIP-2-Gender-Identifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/MetaCLIP-2-Gender-Identifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="prithivMLmods/MetaCLIP-2-Gender-Identifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("prithivMLmods/MetaCLIP-2-Gender-Identifier") model = AutoModelForImageClassification.from_pretrained("prithivMLmods/MetaCLIP-2-Gender-Identifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
MetaCLIP-2-Gender-Identifier
MetaCLIP-2-Gender-Identifier is an image classification vision-language encoder model fine-tuned from facebook/metaclip-2-worldwide-s16 for a single-label classification task. It is designed to predict the gender of a person from an image using the MetaClip2ForImageClassification architecture.
MetaCLIP 2: A Worldwide Scaling Recipe : https://huggingface.co/papers/2507.22062
Classification Report:
precision recall f1-score support
female 0.9815 0.9631 0.9722 1600
male 0.9638 0.9819 0.9728 1600
accuracy 0.9725 3200
macro avg 0.9727 0.9725 0.9725 3200
weighted avg 0.9727 0.9725 0.9725 3200
The model categorizes images into two gender classes:
- Class 0: "female"
- Class 1: "male"
Run with Transformers
!pip install -q transformers torch pillow gradio
import gradio as gr
import torch
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
# Model name from Hugging Face Hub
model_name = "prithivMLmods/MetaCLIP-2-Gender-Identifier"
# Load processor and model
processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(model_name)
model.eval()
# Define labels
LABELS = {
0: "female",
1: "male"
}
def age_classification(image):
"""Predict the age group of a person from 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()
predictions = {LABELS[i]: round(probs[i], 3) for i in range(len(probs))}
return predictions
# Build Gradio interface
iface = gr.Interface(
fn=age_classification,
inputs=gr.Image(type="numpy", label="Upload Image"),
outputs=gr.Label(label="Predicted Gender"),
title="MetaCLIP-2-Gender-Identifier",
description="Upload an image to predict the person's gender."
)
# Launch app
if __name__ == "__main__":
iface.launch()
Sample Inference:
Intended Use:
The MetaCLIP-2-Gender-Identifier model is designed to classify images into gender categories. Potential use cases include:
- Demographic Analysis: Supporting research and business insights into gender-based distribution.
- Health and Fitness Applications: Assisting in gender-specific analytics and recommendations.
- Security and Access Control: Supporting gender-based identity verification systems.
- Retail and Marketing: Enabling improved personalization and customer segmentation.
- Forensics and Surveillance: Assisting in identity estimation for investigative purposes.
- Downloads last month
- 9
Model tree for prithivMLmods/MetaCLIP-2-Gender-Identifier
Base model
facebook/metaclip-2-worldwide-s16




