Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Mar 17, 2024
1 parent 6231f04 commit 1ff6cd5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tools/lightglue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ fn inference(

let window = primary_window.single();

let images = vec![
let images = [
images.get(&input.a).expect("failed to get image asset"),
images.get(&input.b).expect("failed to get image asset"),
];
let images = images.iter().map(|image| *image).collect::<Vec<_>>();

let glued_pairs: Result<Vec<(usize, usize, Vec<GluedPair>)>, String> = (|| {
let onnx = onnx_assets.get(&lightglue.onnx).ok_or("failed to get ONNX asset")?;
Expand All @@ -77,7 +76,7 @@ fn inference(

Ok(lightglue_inference(
session,
images.as_slice(),
&images,
))
})();

Expand Down Expand Up @@ -109,8 +108,8 @@ fn inference(
let image_width = images[0].width() as f32;
let image_height = images[0].height() as f32;

let display_width = window.width() as f32 / 2.0;
let display_height = window.height() as f32 / 2.0;
let display_width = window.width() / 2.0;
let display_height = window.height() / 2.0;

let scale_x = display_width / image_width;
let scale_y = display_height / image_height;
Expand Down Expand Up @@ -145,8 +144,8 @@ fn inference(
let image_width = images[1].width() as f32;
let image_height = images[1].height() as f32;

let display_width = window.width() as f32 / 2.0;
let display_height = window.height() as f32 / 2.0;
let display_width = window.width() / 2.0;
let display_height = window.height() / 2.0;

let scale_x = display_width / image_width;
let scale_y = display_height / image_height;
Expand Down

0 comments on commit 1ff6cd5

Please sign in to comment.