TinyFox 1.0
TinyFox 1.0 is a tiny one-class red fox detector trained for night/IR camera-trap footage.
The model is based on a lightweight NanoDet-style detector with multi-scale heads at strides 8/16/32. It predicts one class: red_fox.
Files
hf_tinyfox_1_0/
βββ TinyFox_1-0.pt PyTorch state_dict checkpoint
βββ tinyfox_config.json architecture & preprocessing metadata
βββ export_all_formats.ps1 export script
βββ upload_to_hf.ps1 Hugging Face upload helper
βββ README.md this file
βββ onnx/
β βββ TinyFox_1-0_fp32.onnx FP32 ONNX (safest generic export)
β βββ TinyFox_1-0_fp16.onnx FP16 ONNX (GPU/NPU runtimes)
β βββ TinyFox_1-0_int8.onnx INT8 dynamic-quantized ONNX
βββ safetensors/
β βββ TinyFox_1-0_bf16.safetensors BF16 weights archive
β βββ TinyFox_1-0_fp16.safetensors FP16 weights archive
βββ torchscript/
β βββ TinyFox_1-0_torchscript.pt TorchScript trace
βββ tflite/
β βββ TinyFox_1-0.tflite TFLite (float32 + float16)
βββ gguf/
β βββ TinyFox_1-0_fp16.gguf GGUF weights archive
βββ acuity/ ACUITY NPU bundle
βββ nanodet.onnx
βββ nanodet_acuity.json
βββ README_ACUITY.txt
βββ calibration_images.txt
Metrics
Validation after Frigate hard-negative refinement:
| Metric | Value |
|---|---|
| mAP@0.50 | 0.9925 |
| Recall@0.50 | 1.0000 |
| Precision@eval threshold | 0.0558 |
| Mean matched IoU | 0.8819 |
| Validation loss | 1.3707 |
The precision value above is measured with a low evaluation threshold for mAP-style scoring and should not be interpreted as the recommended deployment threshold.
Intended Use
- Red fox detection in night/IR camera footage.
- Edge/NPU deployment experiments.
- Wildlife monitoring pipelines where zoning and post-processing can be used to reduce static-scene false positives.
Recommended inference confidence range:
- Start with
0.25. - Lower toward
0.15if misses are unacceptable. - Raise toward
0.35if false positives are unacceptable.
For static cameras, use zones to suppress detections in impossible/irrelevant areas such as timestamp overlays, sky, fixed leaf piles, or walls.
Limitations
- One class only: red fox.
- Optimized for night/IR footage, not broad daytime wildlife detection.
- Validation contains pseudo-labeled and project-specific data, so metrics may overestimate general-world accuracy.
- Post-processing is required for ONNX/ACUITY raw outputs.
- GGUF is included only as a weights archive format, not as a standard detector runtime.
PyTorch Usage
From the original project repository:
python -m foxdetect.infer_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --image test.jpg --output result.jpg --conf 0.25
For video:
python -m foxdetect.infer_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --video input.mp4 --output result.mp4 --conf 0.25
Architecture parameters:
img_size = 512
width = 1.0
reg_max = 16
strides = 8, 16, 32
classes = red_fox
Preprocessing
Input image preprocessing:
RGB
resize to 512 x 512
scale to 0..1
normalize mean = [0.485, 0.456, 0.406]
normalize std = [0.229, 0.224, 0.225]
layout = NCHW
ONNX Outputs
The ONNX export returns raw detector head tensors:
cls_s8, reg_s8
cls_s16, reg_s16
cls_s32, reg_s32
Post-processing steps:
- Apply sigmoid to class logits.
- Decode DFL regression with
reg_max=16. - Use strides
8,16,32. - Scale decoded boxes back to the source image size.
- Apply thresholding and NMS.
Export Commands
Run from the repository root:
.\hf_tinyfox_1_0\export_all_formats.ps1
Individual commands:
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format onnx --dtype fp32 --output hf_tinyfox_1_0\onnx\TinyFox_1-0_fp32.onnx
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format onnx --dtype fp16 --output hf_tinyfox_1_0\onnx\TinyFox_1-0_fp16.onnx
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format onnx-int8 --output hf_tinyfox_1_0\onnx\TinyFox_1-0_int8.onnx
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format safetensors --dtype bf16 --output hf_tinyfox_1_0\safetensors\TinyFox_1-0_bf16.safetensors
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format safetensors --dtype fp16 --output hf_tinyfox_1_0\safetensors\TinyFox_1-0_fp16.safetensors
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format torchscript --output hf_tinyfox_1_0\torchscript\TinyFox_1-0_torchscript.pt
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format acuity --output hf_tinyfox_1_0\acuity
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format tflite --output hf_tinyfox_1_0\tflite\TinyFox_1-0.tflite
python -m foxdetect.export_nanodet --checkpoint hf_tinyfox_1_0\TinyFox_1-0.pt --format gguf --dtype fp16 --output hf_tinyfox_1_0\gguf\TinyFox_1-0_fp16.gguf
ACUITY Notes
Use the acuity/ export folder for Vivante/TIM-VX style NPU toolchains. The ACUITY bundle contains:
nanodet.onnxnanodet_acuity.jsonREADME_ACUITY.txtcalibration_images.txt
For INT8/INT4 deployment, prefer the vendor calibration flow from the FP32 ONNX model instead of generic ONNX INT4.
Upload To Hugging Face
huggingface-cli login
huggingface-cli repo create TinyFox-1.0 --type model
.\hf_tinyfox_1_0\upload_to_hf.ps1 -RepoId YOUR_USERNAME/TinyFox-1.0
Training Data Summary
The detector was trained from a combined night-focused dataset including:
- Real red fox night/camera-trap images.
- LocateAnything-assisted UNSW night red fox pseudo-labels.
- Hard negatives from non-fox VOC night animals.
- Frigate false-positive negatives from deployment-like IR footage.
Hard negatives were important for reducing false positives on branches, leaves, IR glare, and static bright ground regions.
- Downloads last month
- 18
We're not able to determine the quantization variants.
Evaluation results
- mAP@0.50 on Night/IR red fox validation splitself-reported0.993
- mean matched IoU on Night/IR red fox validation splitself-reported0.882