Format the face work with the workspace's own rustfmt
Not authored in this session. `cargo fmt --all` reformats every crate, so running it while working on `dr-segment` picked up five files from the recent face and library work that had been committed unformatted. Committed on its own rather than swept into the change that happened to produce it: the diff is pure whitespace, and mixed into a commit that alters an algorithm it would be noise in exactly the place someone is trying to read carefully. `cargo fmt --all -- --check` is a CI gate (tools/ci-local.sh), so this had to land somewhere regardless. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -472,12 +472,7 @@ fn reduce_for_detection(rgba: &[u8], width: usize, height: usize) -> (usize, usi
|
||||
///
|
||||
/// Split out so the averaging can be tested at a size a test can reason about
|
||||
/// by hand, rather than by building a 1600px fixture.
|
||||
fn reduce_to(
|
||||
rgba: &[u8],
|
||||
width: usize,
|
||||
height: usize,
|
||||
target: usize,
|
||||
) -> (usize, usize, Vec<f32>) {
|
||||
fn reduce_to(rgba: &[u8], width: usize, height: usize, target: usize) -> (usize, usize, Vec<f32>) {
|
||||
let long = width.max(height);
|
||||
if long <= target {
|
||||
// Already small enough; convert without resampling rather than round
|
||||
@@ -1378,7 +1373,13 @@ mod tests {
|
||||
// The failure this guards is silent: landmarks left in the detector's
|
||||
// coordinates put every crop near the top-left corner of the frame,
|
||||
// which produces faces that look like faces of something else.
|
||||
let lm = [(10.0, 20.0), (30.0, 40.0), (50.0, 60.0), (70.0, 80.0), (90.0, 100.0)];
|
||||
let lm = [
|
||||
(10.0, 20.0),
|
||||
(30.0, 40.0),
|
||||
(50.0, 60.0),
|
||||
(70.0, 80.0),
|
||||
(90.0, 100.0),
|
||||
];
|
||||
let out = scale_landmarks(&lm, 4.0, 2.0);
|
||||
assert_eq!(out[0], (40.0, 40.0));
|
||||
assert_eq!(out[4], (360.0, 200.0));
|
||||
|
||||
Reference in New Issue
Block a user