💡 Examples#
The examples below demonstrate pyppbox configuration, detection, tracking, ReID, evaluation, and optional modules. Install the package and required model/data wheels first; see 🚀 Getting Started.
Examples 1–14 use the standalone/direct-module interfaces; example 12 also includes the V4 ArcFace/AdaFace reiders. Examples 15–18 cover additional V4 workflows. Install each example’s optional requirements from the repository root before changing directories.
All example scripts use the repository’s examples/ directory as their working
directory. From the repository root:
cd examples
python example_01_basic.py
For the newer command-line examples, use the same working directory:
python example_15_rfdetr.py --device cpu --frames 30
python example_16_export_adaface_onnx.py --help
python example_17_benchmark_faces.py --help
python example_18_onnx_face_reid.py --help
Relative data/, cfg/, single_config/, configuration-file, and output
paths resolve from this working directory. Examples 3, 4, 5, 11, and 13 contain
C:/pyppbox_v3/ placeholders in their scripts or custom configs; replace these
with your installed pyppbox directory. Find it with:
python -c "import os, pyppbox; print(os.path.dirname(pyppbox.__file__))"
Example 12 retrains the FaceNet, Torchreid OSNet-AIN, Torchreid OSNet, ArcFace, and AdaFace GTA V classifiers. Example 18 trains and recognizes a face using a custom ArcFace/AdaFace configuration. Model requirements are documented in Supported ReIDers. Device settings and automatic selection are described in Devices.
ℹ️ Source code and required input files are available here: {pyppbox repo}/examples.
- Example 1: Use some basic standalone functions
- Example 2: Use pyppbox’s internal config directory
- Example 3: Set a custom config directory
- Example 4: Set the main detector/tracker/reider by a YAML or JSON file
- Example 5: Set the main modules by a raw/ready dictionary
- Example 6: Set the main modules by names
- Example 7: Use result tools
- Example 8: Use real-time evaluation tools
- Example 9: Compare a generated result to a reference or ground-truth
- Example 10: Use GT (Ground-truth) as a detector
- Example 11: Train a classifier using a supported reider
- Example 12: Retrain GTA V classifiers for all supported reiders
- Example 13: Use a supported module directly
- Example 14: Use pyppbox in multithreading application
- Example 15: Use RF-DETR detection and SORT tracking
- Example 16: Export an AdaFace embedding model to ONNX
- Example 17: Compare FaceNet, ArcFace, and AdaFace
- Example 18: Recognize faces and train an ArcFace or AdaFace classifier