rustface
Library Listed Dormant
Face detection library, based on the C++ SeetaFace engine.
- Downloads
- 4,231
- Dependents
- 3
- Stars
- 436
- Forks
- 40
- Contributors
- 6
- Commits
- 183
- Latest release
- 0.1.7 ·
About
SeetaFace detection library for the Rust programming language
Example of demo program output
- SEETAFACE C++ – Github repository for the original library
- PYTHON BINDINGS – call Rustface from Python code
- LICENSE – licensed under permissive BSD 2-Clause
About
SeetaFace Detection is an implementation of Funnel-Structured cascade, which is designed for real-time multi-view face detection. FuSt aims at a good trade-off between accuracy and speed by using a coarse-to-fine structure. It consists of multiple view-specific fast LAB cascade classifiers at early stages, followed by coarse Multilayer Perceptron (MLP) cascades at later stages. The final stage is one unified fine MLP cascade, processing all proposed windows in a centralized style.
Performance
You can run the criterion benchmarks using cargo bench.
Using nightly Rust
The nightly branch contains a slightly (~20%) faster version of rustface. This speedup is made possible by using explicit SIMD intrinsics. If you want to use this branch, you need an older nightly toolchain.
rustup toolchain install nightly-2018-01-15
rustup default nightly-2018-01-15
Read the full README
Regarding the performance of the nightly branch: crude manual benchmarking showed that this nightly Rust version of SeetaFace is slightly faster than the original C++ version. In this particular test the Rust version has been 4% faster on average than its C++ counterpart. When using multiple threads and enabling LTO (link-time optimization), Rust performance is a tad better (I observe a 8% boost):
Multi-threaded (Rayon threads set to 2)
LTO enabled
* Rustface *
samples (ms): 787,789,795,795,787,785,791,799,795,788
mean (ms): 791.1
stddev (ms): 4.39
Usage example
extern crate rustface;
use rustface::{Detector, FaceInfo, ImageData};
fn main() {
let mut detector = rustface::create_detector("/path/to/model").unwrap();
detector.set_min_face_size(20);
detector.set_score_thresh(2.0);
detector.set_pyramid_scale_factor(0.8);
detector.set_slide_window_step(4, 4);
let mut image = ImageData::new(bytes, width, height);
for face in detector.detect(&mut image).into_iter() {
// print confidence score and coordinates
println!("found face: {:?}", face);
}
}
How to build
The project is a library crate and also contains a runnable example for demonstration purposes.
Then just use the standard Cargo build command:
cargo build --release
Run demo
Code for the demo is located in examples/image_demo.rs file. It performs face detection for a given image and saves the result into a file in the working directory.
You can run the demo using:
cargo run --release --example image_demo model/seeta_fd_frontal_v1.0.bin assets/test/scientists.jpg
Please note that this library makes use of Rayon framework to parallelize some computations. By default, Rayon spawns the same number of threads as the number of CPUs (logicals cores) available. Instead of making things faster, the penalty of switching between so many threads may severely hurt the performance, so it's strongly advised to keep the number of threads small by manually setting RAYON_NUM_THREADS environment variable.
# empirically found to be the sweet spot for the number of threads
export RAYON_NUM_THREADS=2
cargo run --release --example image_demo model/seeta_fd_frontal_v1.0.bin assets/test/scientists.jpg
Note that Rayon can be disabled entirely at compile time by providing the --no-default-features flag.
TODO
- Use stable SIMD intrinsics when available
- Benchmark benefit of parallelisation. Compiler improvements may have reduced the relative benefit of parallel processing, especially when running on smaller images. Simplify where possible.
- Parallelize remaining CPU intensive loops
- Tests (it would make sense to start with an integration test for
Detector::detect, based on the results retrieved from the original library)
Authors
Andrei Tomashpolskiy @atomashpolskiy
Original developer and maintainer
Jurriaan BW @jjhbw
Contributor and chief maintainer
Ashley @expenses
Contributor. Added the switch from OpenCV to Image.
This library is based on the following works:
Face detection method described in the paper: "Funnel-structured cascade for multi-view face detection with alignment awareness, Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen. In Neurocomputing (under review)"
License
Original SeetaFace Detection is released under the BSD 2-Clause license. This project is a derivative work and uses the same license as the original.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- BSD-2-Clause
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Face detection library, based on the C++ SeetaFace engine. |
4,231 downloads over 30 days | 3 | 436 | 0.1.7 | GPU support unknown | No native code found | BSD-2-Clause |
|
imageproc Featured
Image processing operations |
1,165,048 downloads over 30 days | 370 | 986 | 0.27.0 | GPU support unknown | Binds native code: sdl2-sys (feature display-window) | MIT |
|
inference Listed
Ultralytics YOLO inference library and CLI for Rust |
2,609 downloads over 30 days | 1 | 217 | 0.0.56 | CUDA, WebGPU, ROCm | Binds native code: ort-sys, ffmpeg-sys-next (feature video), openvino-sys (feature intel) | AGPL-3.0 |
|
kornia-rs Listed
Low-level computer vision library in Rust |
2,294 downloads over 30 days | 6 | 751 | 0.1.5 | CUDA | Binds native code: glib-sys (feature gstreamer), gobject-sys (feature gstreamer), gstreamer-app-sys (feature gstreamer), gstreamer-base-sys (feature gstreamer), gstreamer-sys (feature gstreamer) and 1 more | Apache-2.0 |
|
usls Listed
A Rust library integrated with ONNXRuntime, providing a collection of ML models. |
355 downloads over 30 days | 1 | 447 | 0.1.11 | CUDA, ROCm | Binds native code: ffmpeg-sys-next (feature video), ort-sys (feature acl) | MIT |
|
A Rust library for object detection via SSD MobileNet. |
Not measured | Not applicable | 5 | Not measured | Not measured | Not measured | MIT |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 1 active dependents and 1 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 436 stars, 40 forks and 6 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
- The project is dormant and not finished. Dormancy rule
What else the check found
- The last activity is on 4 Apr 2024, 949 days ago. That reaches the 400 days the rules expect, so the project is dormant. Dormancy rule
- The oldest outside issue waits 2205 days for a reply, past the limit of 270. No maintainer replied in 365 days. Rot signals rule
Not measured: Latest release fails cargo check.
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.1.7 base 450, capped at 8 releases = 400: E = 400 daysdormancy: last activity 2024-04-04, 949 days ago, E = 400: dormantrot: oldest unanswered issue 2205 days (limit 270), no maintainer reply in 365 daysfeatured: not featured: active_users 1 < 11 and new_adopters 1 < 9 and repository route stars 436 (needs 4539), forks 40 (needs 434), contributors 6 (needs 79); dormant and not stablelisted: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption1 active dependents, 1 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 1 | crates.io database dump | Yes | |
| New dependents (365 days) | 1 | crates.io database dump | Yes | |
| Peak active dependents | 1 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 2 years ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2024-04-04 | GitHub repository | Yes | |
| Latest release | 2021-06-25 | crates.io database dump | Yes | |
| First release | 2018-01-16 | crates.io database dump | Yes | |
| Latest version | 0.1.7 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 2205 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution8 releases, 4,231 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 8 | crates.io database dump | Yes | |
| Downloads over 30 days | 4231 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository436 stars, 40 forks, 6 contributors, 183 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 436 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 40 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 6 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 183 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | BSD-2-Clause | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 3 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.