BiggerGait (DINOv2-S) trained on CCGR

This repository is a self-contained codebase for running BiggerGait inference. It needs neither the OpenGait codebase nor a separate DINOv2 download: the checkpoint already contains the frozen DINOv2-S backbone, the mask branch and the gait heads.

The checkpoint BiggerGait__SmallDINOv2_Gaitbase_84Frame30_448224_6432HPP32_NoAlign_Sep12B_WiMask_Share_2B_6G-30000.pt was trained on CCGR and comes unmodified from opengait/OpenGait.

Setup

The environment is managed with uv:

git lfs install   # the checkpoint and sample videos are stored with Git LFS
git clone <this repo> && cd <this repo>
uv sync

Smoke test

sample_data/ holds 36 CCGR-MINI videos (6 test identities, 2 gallery and 4 probe sequences each) together with reference embeddings. The test embeds the videos, runs the CCGR-MINI protocol on them and compares against the references:

uv run python scripts/smoke_test.py
36 sequences from 6 identities, device: cuda
{ "Rank-1": 95.83, "Rank-5": 100.0, "Rank-10": 100.0, "mAP": 96.71, "mINP": 96.76, ... }
cosine similarity to reference embeddings: min 1.00000, mean 1.00000
smoke test passed

It takes a few seconds on a GPU and a few minutes on CPU (--device cpu).

Usage

import torch
from biggergait import BiggerGait, load_video
from biggergait.evaluation import pairwise_distance

device = torch.device("cuda")
model = BiggerGait.from_checkpoint(
    "BiggerGait__SmallDINOv2_Gaitbase_84Frame30_448224_6432HPP32_NoAlign_Sep12B_WiMask_Share_2B_6G-30000.pt"
).to(device)

def embed(path):
    with torch.autocast("cuda"):
        return model(load_video(path).to(device))  # [256, 192]

a = embed("sample_data/CCGR-MINI-RGB/613/AS1/180_1.avi/180_1rgb_f-613-AS1.avi")
b = embed("sample_data/CCGR-MINI-RGB/613/DT1/67_5_2.avi/67_5_2rgb_f-613-DT1.avi")
print(pairwise_distance(a[None], b[None]))  # smaller = more likely the same person
  • Input: a sequence of RGB crops of one walking person. load_video reads a video of such crops; preprocess_frames takes a list of BGR uint8 frames (OpenCV convention). Every frame is resized to a height of 256 keeping its aspect ratio, center padded / cropped to a width of 128 and ImageNet normalized. The model upsamples to 448x224 internally. No silhouettes or alignment are needed.
  • Output: one [256, 192] embedding per sequence — a 256-d descriptor for each of 32 horizontal parts x 6 DINOv2 layer groups. Sequences are compared with the Euclidean distance averaged over the 192 parts (pairwise_distance).

Evaluation on CCGR-MINI

Download the CCGR-MINI RGB videos from the CCGR repository and point the script at the raw .avi tree (<root>/<id>/<type>/<view>/<video>.avi, no pretreatment required):

uv run python scripts/evaluate.py --data-root CCGR_MINI_RGB/CCGR-MINI-RGB-V1

The protocol follows OpenGait's evaluate_CCGR_MINI with the partition in datasets/CCGR-MINI.json: test identities only, the listed sequences are the gallery and all remaining ones are probes.

Result of this repository on a partial copy of CCGR-MINI (71 of the 400 test identities, 3448 probe and 140 gallery sequences, fp16, one RTX 4090, ~7 min):

Rank-1 Rank-5 Rank-10 mAP mINP
90.81 97.19 98.49 89.27 84.92

These numbers are not comparable to published full-benchmark results: the gallery here is about 5x smaller, which makes retrieval easier.

Notes on the port

  • biggergait/model.py is an inference-only port of OpenGait's BiggerGait__DINOv2; module names follow the checkpoint, which loads with strict=True after dropping the training-only classifiers (BNNecks) and the duplicated aliases of the two shared gait heads (Gait_List).
  • biggergait/dinov2.py is a minimal DINOv2 ViT. With the backbone weights from the checkpoint (identical to facebook/dinov2-small) its per-layer outputs match transformers.Dinov2Model exactly at 448x224.
  • The preprocessing used to train the checkpoint is not documented. The recipe above is OpenGait's datasets/pretreatment_rgb.py applied to the raw CCGR-MINI frames; it scored best among the variants tried on the data above (removing the black border CCGR-MINI adds around each crop first, or ignoring the aspect ratio, cost 1-3 points of Rank-1).

References

  • BiggerGait: Unlocking Gait Recognition with Layer-wise Representations from Large Vision Models (NeurIPS 2025) — paper, code
  • Cross-Covariate Gait Recognition: A Benchmark (AAAI 2024) — paper, dataset

The sample videos in sample_data/ are taken from CCGR-MINI and remain subject to the terms of that dataset.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Papers for ernestchu/bigger-gait-ccgr