FastReID Documentation

repository·master·Indexed 26 days ago

https://github.com/jdai-cv/fast-reid

A PyTorch-based research platform and toolbox for state-of-the-art re-identification (re-ID) algorithms, including person, vehicle, and face recognition. The repository includes implementations for Cross-domain Person Re-ID, semi-supervised domain generalizable Re-ID (SSKD), and specialized projects such as FastAttr, FastClas, FastDistill, FastFace, and FastRetri. It provides guides for dataset configuration (Market1501, DukeMTMC-reID, MSMT17), Docker deployment, and TensorRT integration.

Tokens
12.3K
Snippets
38
Records
87
Agent score
87%

What's inside FastReID

  1. Overview of SSKD (Semi-Supervised Domain Generalizable Person Re-Identification)

    master
    SSKD is a semi-supervised feature learning framework designed to learn domain-general representations. It is implemented based on FastReID v1.0.0. It utilizes a student-teacher framework to improve generalization across different domains.
  2. Overview of Cross-domain Person Re-Identification

    master

    This project provides implementations for Cross-domain Person Re-Identification, focusing on Unsupervised Learning (USL) and Unsupervised Domain Adaptation (UDA). It includes baselines for transferring models between datasets like DukeMTMC, Market-1501, and MSMT17.

    Key concepts include:

    • Direct Transfer: Models trained on a source-domain dataset and tested directly on a target-domain dataset.
    • UDA Methods: Methods (such as MMT, SpCL, etc.) that are trained end-to-end starting from ImageNet without source-domain pre-training.
    • MLT: An implementation of the NeurIPS-2020 method.
  3. Explore projects built on FastReID

    master

    FastReID serves as a library for various computer vision tasks. The following research projects demonstrate how to use FastReID as a foundation for specialized applications. Note that these are research projects and may have different stability or support levels compared to the core FastReID library.

    Projects by JDAI

    External Projects

    Competitions

  4. Understand ReID model baseline methods

    master

    FastReID baselines use several common methodologies. When reviewing model tables, look for these method names:

  5. Configure data loading with fastreid.data modules

    master

    The fastreid.data package contains the core components for data pipeline management:

    • fastreid.data.build: Used for building data loaders and datasets.
    • fastreid.data.data_utils: Contains utility functions for data processing.
    • fastreid.data.samplers: Provides custom sampling strategies (e.g., for batch construction).
    • fastreid.data.transforms: Contains image augmentation and preprocessing transformations.
  6. NAIC20 Winning Strategy and Tricks

    master

    The 1st place solution for the NAIC20 ReID competition utilizes several specific techniques:

    • Data Augmentation: Combination of RandomErasing, ColorJitter, Augmix, RandomAffine, RandomHorizontallyFlip, Padding, and RandomCrop.
    • Optimization: Adam optimizer with a Warmup + CosineAnnealing LR Scheduler and FP16 mixed precision training.
    • Loss Functions: CircleSoftmax and Pairwise Cosface.
    • Architecture/Pooling: GeM pooling and Channel Shuffle (specifically helpful for encrypted datasets).
    • Ensemble: Distmat Ensemble using resnest101 and resnest200 at different resolutions (192x256 and 192x384).
    • Data Cleaning: Removal of long-tail data (pids with only a single image).
  7. Understand the fastreid.config module

    master
    The fastreid.config module is the central component for managing configuration settings within FastReID. It provides the infrastructure for loading, accessing, and potentially extending configuration parameters used during training, evaluation, and deployment. For detailed usage, refer to the tutorials on configuration management and extending the configuration system.
  8. Train a Partial Re-identification model

    master

    Train a model by executing projects/PartialReID/train_net.py with a specific configuration YAML file.

    To train a re-id network using the IBN-ResNet-50 Backbone with the partial_market.yml configuration, use the following command:

    CUDA_VISIBLE_DEVICES='0,1,2,3' python3 projects/PartialReID/train_net.py --config-file 'projects/PartialReID/configs/partial_market.yml'
  9. Perform loss distillation in FastDistill

    master

    Run loss distillation by setting the MODEL.META_ARCHITECTURE to Distiller. You must provide the teacher model's configuration and weights using the KD.MODEL_CONFIG and KD.MODEL_WEIGHTS arguments. Note that these arguments expect a tuple-formatted string.

    # loss distillation
    python3 projects/FastDistill/train_net.py \
    --config-file projects/FastDistill/configs/kd-sbs_r101ibn-sbs_r34.yaml \
    --num-gpus 4 \
    MODEL.META_ARCHITECTURE Distiller \
    KD.MODEL_CONFIG '("projects/FastDistill/logs/dukemtmc/r101_ibn/config.yaml",)' \
    KD.MODEL_WEIGHTS '("projects/FastDistill/logs/dukemtmc/r101_ibn/model_best.pth",)'