Format the two new examples
They were written after the last fmt run and CI gates on --check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -311,7 +311,10 @@ fn full_library(
|
|||||||
// a desktop and a tablet (docs/faces.md §9).
|
// a desktop and a tablet (docs/faces.md §9).
|
||||||
{
|
{
|
||||||
let dim = candidates.first().map(|c| c.embedding.len()).unwrap_or(0);
|
let dim = candidates.first().map(|c| c.embedding.len()).unwrap_or(0);
|
||||||
let flat: Vec<f32> = candidates.iter().flat_map(|c| c.embedding.clone()).collect();
|
let flat: Vec<f32> = candidates
|
||||||
|
.iter()
|
||||||
|
.flat_map(|c| c.embedding.clone())
|
||||||
|
.collect();
|
||||||
let crop_px: Vec<f32> = candidates.iter().map(|c| c.crop_px).collect();
|
let crop_px: Vec<f32> = candidates.iter().map(|c| c.crop_px).collect();
|
||||||
let images: Vec<u64> = candidates.iter().map(|c| c.image).collect();
|
let images: Vec<u64> = candidates.iter().map(|c| c.image).collect();
|
||||||
let view = dr_face::neighbours::Faces {
|
let view = dr_face::neighbours::Faces {
|
||||||
@@ -332,12 +335,8 @@ fn full_library(
|
|||||||
let agglomerate = t.elapsed().as_secs_f64() - scan;
|
let agglomerate = t.elapsed().as_secs_f64() - scan;
|
||||||
|
|
||||||
let t = std::time::Instant::now();
|
let t = std::time::Instant::now();
|
||||||
let _ = dr_face::identity_shares(
|
let _ =
|
||||||
candidates.len(),
|
dr_face::identity_shares(candidates.len(), &clusters, &evidence, dr_face::TOP_MATCHES);
|
||||||
&clusters,
|
|
||||||
&evidence,
|
|
||||||
dr_face::TOP_MATCHES,
|
|
||||||
);
|
|
||||||
println!(
|
println!(
|
||||||
" scan {scan:.2}s ({} evidence pairs) · agglomerate {agglomerate:.2}s · score {:.2}s",
|
" scan {scan:.2}s ({} evidence pairs) · agglomerate {agglomerate:.2}s · score {:.2}s",
|
||||||
evidence.len(),
|
evidence.len(),
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ const DEFAULT_SIZES: [usize; 4] = [2_000, 4_000, 8_000, 18_000];
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let sizes: Vec<usize> = {
|
let sizes: Vec<usize> = {
|
||||||
let given: Vec<usize> = std::env::args().skip(1).filter_map(|a| a.parse().ok()).collect();
|
let given: Vec<usize> = std::env::args()
|
||||||
|
.skip(1)
|
||||||
|
.filter_map(|a| a.parse().ok())
|
||||||
|
.collect();
|
||||||
if given.is_empty() {
|
if given.is_empty() {
|
||||||
DEFAULT_SIZES.to_vec()
|
DEFAULT_SIZES.to_vec()
|
||||||
} else {
|
} else {
|
||||||
@@ -37,7 +40,10 @@ fn main() {
|
|||||||
// no fit of its own would scan at.
|
// no fit of its own would scan at.
|
||||||
let cal = Calibration::default();
|
let cal = Calibration::default();
|
||||||
|
|
||||||
println!("{:>8} {:>9} {:>10} {:>9}", "faces", "scan", "pairs", "GFLOP/s");
|
println!(
|
||||||
|
"{:>8} {:>9} {:>10} {:>9}",
|
||||||
|
"faces", "scan", "pairs", "GFLOP/s"
|
||||||
|
);
|
||||||
for n in sizes {
|
for n in sizes {
|
||||||
let (embeddings, crop_px, images) = population(n);
|
let (embeddings, crop_px, images) = population(n);
|
||||||
let faces = Faces {
|
let faces = Faces {
|
||||||
|
|||||||
Reference in New Issue
Block a user