FastestDetV2: a Light-weight Object Detector

Improvements

  • 2.5% mAP50 & 1% mAP50:95 improvement, with ~20% faster speed compared to FastestDet
  • Assign Guidance Module and SimOTA label assignment for better precision
  • Quantization-aware, reparameterizable MobileOne backbone and convolution modules
FastestDetV2 README gallery 1 FastestDetV2 README gallery 2

Benchmarks

ModelmAP50mAP50:95ResolutionInference time (4x core)Inference time (1x core)Params (M)
FastestDetV227.8%14.0%352X3522.83ms6.95ms0.33M
FastestDetV2-2x36.6%19.9%352X3526.81ms19.88ms1.22M
FastestDet25.3%13.0%352X3523.68ms8.48ms0.24M
NanoDet-m-20.6%320X3207.76ms22.23ms0.95M
YOLOX-Nano-25.8%416X41636.88ms92.52ms0.91M
YOLOv8n56.8%37.4%640X64057.03ms122.63ms7.2M

Tested on EmbedFire LubanCat-4 RK3588S ARM 4*Cortex-A76 CPU@2.0GHz, using NCNN.

Multi-platform Benchmarks

DeviceComputing backendSystemFrameworkInference time (4x core)Inference time (1x core)2x Inference time (4x core)2x Inference time (1x core)
Huawei Atlas 800I A3Ascend 910_9362 (NPU)Linux (arm64)CANN/0.45ms/0.58ms
EmbedFire LubanCat-4RK3588 (CPU) 1Linux (arm64)NCNN2.83ms6.95ms6.81ms19.88ms
EmbedFire LubanCat-4RK3588 (NPU)Linux (arm64)RKNN7.067ms 27.532ms8.04ms 3 9.56ms
Google Pixel 10 Pro XLTensor G5 (CPU)Android (arm64)NCNN2.69ms3.88ms4.66ms6.26ms
OnePlus 6Snapdragon 845 (CPU)Android (arm64)NCNN4.73ms8.14ms11.56ms17.84ms
Dell Precision 3630 TowerCore i9-9900 (CPU) 4Linux (x86_64)NCNN2.90m7.31ms6.86ms19.94ms

1: At 2.0 GHz.
2, 3: RKNNLite.NPU_CORE_0_1_2 is used.
4: At 800MHz.

Model Zoo

DownloadNote
fastestdetv2.pth, fastestdetv2_unfused.pth
fastestdetv2-2x.pth, fastestdetv2-2x_unfused.pth
Model weights
qamobileone.pth
qamobileone-2x.pth
Backbone weights
fastestdetv2.apkAndroid demo
fastestdetv2.bin, fastestdetv2.param
fastestdetv2-2x.bin, fastestdetv2-2x.param
NCNN files
fastestdetv2.onnx
fastestdetv2-2x.onnx
ONNX files
(target platform-specific, not provided)CANN files
(target platform-specific, not provided)RKNN files
fastestdetv2.pt, fastestdetv2_ptq.arm.pt, fastestdetv2_ptq.x86.pt
fastestdetv2-2x.pt, fastestdetv2-2x_ptq.arm.pt, fastestdetv2-2x_ptq.x86.pt
TorchScript files

Usage

Dependencies

pip install -r requirements.txt

Datasets & Configurations

Datasets can be either in Darknet format (like FastestDet, using a text file to list image paths, with labels stored in separate .txt files in the same directory) or in YOLO format (like YOLOv8, where each image has a corresponding .txt label file in a seperate directory). Labels are in cls cx cy w h normalized bboxes.

The .yaml configurations file specifies dataset paths, model settings, and training hyperparameters. Dataset could be either in Darknet format or YOLO format. Class names can also be in a single text file with each line representing a class name. See configs/coco.yaml for example.

Evaluation & Testing

You can evaluate the model with a fused (reparameterized) model weights file.

python3 eval.py --configs CONFIGS_PATH --weight WEIGHTS_PATH

Or test it on an image:

python3 test.py --configs CONFIGS_PATH --weights WEIGHTS_PATH --image IMAGE_PATH

Training

Download the backbone weights and place it under weights/qamobileone.pth and weights/qamobileone-2x.pth, and run:

python3 train.py --configs CONFIGS_PATH

Or finetune it with an unfused weights file:

python3 train.py --configs CONFIGS_PATH --weights WEIGHTS_PATH

Deployment

ONNX & TorchScript

Export to ONNX and TorchScript format with:

python3 test.py --configs CONFIGS_PATH --weights WEIGHTS_PATH --export

PT2E PTQ

Post-training quantization for x86 (with X86InductorQuantizer) or arm (with XNNPackQuantizer) platforms, with fused weights:

python3 quant.py --configs CONFIGS_PATH --weights WEIGHTS_PATH --image IMAGE_PATH --target TARGET_PLATFORM

NCNN

Follow deploy/ncnn/README.md or deploy/ncnn_android/README.md (for Android).

CANN

Follow deploy/cann/README.md.

RKNN

Follow deploy/rknn/README.md.

Citation

@misc{=FastestDetV2,
    title={FastestDetV2: Even faster and stronger than FastestDet},
    author={Pairman},
    howpublished = {\url{https://github.com/Pairman/FastestDetV2}},
    year={2025}
}

References