Warning: this is just a toy project for playing around with buffalo face recognition model.
A blazingly-fast face detection inference tool built in Rust using ONNX Runtime.
This tool can process both single images and directories of images, providing flexible output options for detection results.
git clone https://github.com/your-username/face-detection-rs.git
cd face-detection-rs
cargo build --release
Obtain buffalo model from InsightFace. Note: this was tested with buffalo_l. Extract the det_10g.onnx file from the downloaded zip file and place it in the same directory as the executable. Prepare your images (note: 640x640 is recommended) and run the tool.
face-detection -i <INPUT> [-o <OUTPUT>] [-t <THRESHOLD>] [-v]
-i, --input <PATH>
: Input image or directory path (required)-o, --output <PATH>
: Output file or directory path (optional)-t, --threshold <FLOAT>
: Detection confidence threshold (default: 0.5)-v, --verbose
: Print detection details to console-m, --model
: Model ONNX file path (default: det_10g.onnx)-h, --help
: Show help information-V, --version
: Show version information
- Process a single image and save with detection boxes:
face-detection -i image.jpg -o output.jpg -t 0.6
- Process an image and only print detections:
face-detection -i image.jpg -v
- Process all images in a directory and save results:
face-detection -i ./images -o ./processed -v
- Process directory and only print detections:
face-detection -i ./images -v