MetaCLIP-2-Age-Range-Estimator
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 age range of a person from an image using the
MetaClip2ForImageClassification
architecture.
The model categorizes images into five age ranges:
Class 0:
"Child 0-12"
Class 1:
"Teenager 13-20"
Class 2:
"Adult 21-44"
Class 3:
"Middle Age 45-64"
Class 4:
"Aged 65+"
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-Age-Range-Estimator"# Load processor and model
processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(model_name)
model.eval()
# Define labels
LABELS = {
0: "Child (0–12)",
1: "Teenager (13–20)",
2: "Adult (21–44)",
3: "Middle Age (45–64)",
4: "Aged (65+)"
}
defage_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 inrange(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 Age Group Probabilities"),
title="MetaCLIP-2 Age Range Estimator",
description="Upload a face image to estimate the person's age group using MetaCLIP-2."
)
# Launch appif __name__ == "__main__":
iface.launch()
Sample Inference:
Intended Use:
The
MetaCLIP-2-Age-Range-Estimator
model is designed to classify images into five age categories.
Potential use cases include:
Demographic Analysis:
Supporting research and business insights into age distribution.
Health and Fitness Applications:
Assisting in age-based health recommendations.
Security and Access Control:
Enabling age verification systems.
Retail and Marketing:
Enhancing personalization and customer profiling.
Forensics and Surveillance:
Supporting age estimation in investigative and security contexts.
Runs of prithivMLmods MetaCLIP-2-Age-Range-Estimator on huggingface.co
97
Total runs
0
24-hour runs
-11
3-day runs
-47
7-day runs
-2
30-day runs
More Information About MetaCLIP-2-Age-Range-Estimator huggingface.co Model
More MetaCLIP-2-Age-Range-Estimator license Visit here:
MetaCLIP-2-Age-Range-Estimator huggingface.co is an AI model on huggingface.co that provides MetaCLIP-2-Age-Range-Estimator's model effect (), which can be used instantly with this prithivMLmods MetaCLIP-2-Age-Range-Estimator model. huggingface.co supports a free trial of the MetaCLIP-2-Age-Range-Estimator model, and also provides paid use of the MetaCLIP-2-Age-Range-Estimator. Support call MetaCLIP-2-Age-Range-Estimator model through api, including Node.js, Python, http.
MetaCLIP-2-Age-Range-Estimator huggingface.co is an online trial and call api platform, which integrates MetaCLIP-2-Age-Range-Estimator's modeling effects, including api services, and provides a free online trial of MetaCLIP-2-Age-Range-Estimator, you can try MetaCLIP-2-Age-Range-Estimator online for free by clicking the link below.
prithivMLmods MetaCLIP-2-Age-Range-Estimator online free url in huggingface.co:
MetaCLIP-2-Age-Range-Estimator is an open source model from GitHub that offers a free installation service, and any user can find MetaCLIP-2-Age-Range-Estimator on GitHub to install. At the same time, huggingface.co provides the effect of MetaCLIP-2-Age-Range-Estimator install, users can directly use MetaCLIP-2-Age-Range-Estimator installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
MetaCLIP-2-Age-Range-Estimator install url in huggingface.co: