/ Модель

Характеристики

Лицензия
Apache 2.0
Архитектура
vit_gender · dense
Базовая модель
vit-base-patch16-224
Опубликована
5 июл 2026

footfall-analysis-vit-stage1

Классификация изображенийИзображение → label3 профессии

Дообученный Vision Transformer классифицирует изображения людей по двум категориям для агрегированной аналитики потока посетителей.

10скачиваний за 30 дней1лайквеса обновлены5 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель abhshkp/footfall-analysis-vit-stage1 — дообученный Vision Transformer для бинарной классификации изображений людей по категориям female и male. Разработчик в карточке не назван. Модель основана на google/vit-base-patch16-224: представление токена [CLS] передаётся линейному классификатору, который выдаёт два логита. Веса предназначены для обработки обрезанных изображений людей, например, после детектора и трекера объектов, в системах анализа потока посетителей и розничной аналитики.

Модель подходит для получения агрегированной статистики о распределении предсказанных категорий в магазинах, общественных пространствах и местах проведения мероприятий. Она принимает изображения и выдаёт метку класса. Лицензия — Apache 2.0.

Классификация ограничена двумя категориями и не отражает всего разнообразия гендерных идентичностей. Качество может снижаться при низком разрешении, размытии, сильных ракурсах и перекрытиях; возможны различия в точности для людей разного возраста и этнической принадлежности, а также при разном освещении.

Сценарии применения

  • оценка распределения предсказанных категорий посетителей магазина
  • подсчёт демографической статистики для цифровых рекламных экранов
  • анализ состава аудитории на мероприятиях
  • классификация обрезанных изображений людей после детектора и трекера

Ограничения

Модель предсказывает только две категории — female и male — и не охватывает разнообразие гендерных идентичностей. Точность может снижаться при низком разрешении, размытии, сложном ракурсе и перекрытиях; возможны демографические смещения.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ViT Gender Classifier (Stage 1)

This repository contains the stage-1 weights for a fine-tuned Vision Transformer (ViT) model optimized for binary gender classification (female and male). The model is designed to be integrated into footfall analysis, retail analytics, and demographic tracking pipelines.

Model Description

The model utilizes the google/vit-base-patch16-224 architecture as its backbone, which was pre-trained on ImageNet-21k at a resolution of 224x224 pixels. It wraps the ViT backbone in a custom PyTorch class (GenderClassifier) that extracts the representation of the [CLS] token and passes it to a linear classifier layer to produce binary logits.

  • Developer: [Your Name / Organization]
  • Model Type: Image Classification (Vision Transformer backbone)
  • Base Model: google/vit-base-patch16-224
  • Language(s): English (API / Documentation)
  • License: Apache 2.0

Intended Uses & Limitations

Intended Use Cases

  1. Footfall Analysis & Retail Analytics: Identifying gender distribution trends over time in public spaces, retail stores, or venues.
  2. Audience Demographics: Anonymized demographic statistics for digital signage, event registration spaces, or public plazas.
  3. Pipeline Integration: Designed to follow an upstream person-detector (e.g., YOLO, Faster R-CNN) and person-tracker (e.g., DeepSORT, ByteTrack), classifying cropped bounding boxes of detected individuals.

Limitations

  • Binary Assumption: The model restricts classification to binary categories (female and male), which does not capture the full diversity of gender identities.
  • Image Quality Dependencies: Accuracy decreases significantly with low-resolution crops, motion blur, extreme angles (e.g., top-down security cameras), or heavy occlusions.
  • Demographic Bias: Vision-based gender classification models can exhibit performance disparities across different ages, ethnicities, and lighting conditions.

How to Get Started (Inference)

Below is a detailed guide on how to preprocess inputs and run inference using PyTorch and the Hugging Face transformers library.

1. Model Architecture Definition

Ensure the custom GenderClassifier class matches the structure expected by the saved pytorch_model.bin weights:

import torch
import torch.nn as nn
from transformers import ViTModel

class GenderClassifier(nn.Module):
    def __init__(self, config):
        super().__init__()
        self.vit = ViTModel.from_pretrained(config.vit_model_name)
        self.classifier = nn.Linear(self.vit.config.hidden_size, config.num_labels)
        
    def forward(self, pixel_values):
        outputs = self.vit(pixel_values=pixel_values)
        # Extract the sequence output for the CLS token
        sequence_output = outputs.last_hidden_state[:, 0, :]
        # Pass to classification head
        logits = self.classifier(sequence_output)
        return logits

2. Loading the Model

import torch
from transformers import ViTConfig

# Path to the directory containing config.json and pytorch_model.bin
model_path = "./path_to_model_directory"

# 1. Load the configuration
config = ViTConfig.from_pretrained(model_path)

# 2. Instantiate the model skeleton
model = GenderClassifier(config)

# 3. Load the fine-tuned weights
model.load_state_dict(torch.load(f"{model_path}/pytorch_model.bin", map_location="cpu"))
model.eval()

3. Preprocessing and Inference Pipeline

from PIL import Image
import torch
import torch.nn.functional as F
from transformers import ViTImageProcessor

# Initialize the image processor corresponding to the base ViT model
processor = ViTImageProcessor.from_pretrained("google/vit-base-patch16-224")

# Load and preprocess an image (crop of a person)
image_path = "path_to_person_crop.jpg"
image = Image.open(image_path).convert("RGB")

# Preprocess image to tensor matching expected resolution (224x224) and normalization
inputs = processor(images=image, return_tensors="pt")

# Run inference
with torch.no_grad():
    logits = model(pixel_values=inputs.pixel_values)
    probabilities = F.softmax(logits, dim=-1)
    predicted_class_id = torch.argmax(probabilities, dim=-1).item()

# Map prediction to label
id2label = config.id2label  # {0: "female", 1: "male"}
print(f"Predicted class: {id2label[str(predicted_class_id)]} ({probabilities[0][predicted_class_id].item():.4f})")

Training and Evaluation Details (Suggested Setup)

Training Data

The model was fine-tuned on person crops extracted from pedestrian detection datasets, annotated with binary gender labels.

Training Procedure

  • Optimizer: AdamW
  • Learning Rate: 2e-5 with linear warmup and decay
  • Loss Function: Cross-Entropy Loss
  • Batch Size: 32 or 64
  • Precision: Mixed Precision (FP16)

Evaluation Metrics

  • Accuracy: The proportion of correctly classified instances.
  • Precision / Recall / F1-Score: Monitored per class to ensure balanced predictions and minimal bias.

Ethical Considerations

When deploying automated gender classification models, care must be taken to:

  • Prioritize Privacy: Do not store original face or body images. Process images in-memory and store only aggregated count statistics (e.g., "55% female, 45% male").
  • Transparency: Disclose the use of automated demographic tracking to individuals in the monitored environment where legally required.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · image-classification

Нельзя запустить

Архитектура vit_gender неизвестна transformers в образе рантайма.

Класс архитектуры
GenderClassifier
Ревизия весов
9078d5a

0 моделей