mirror of
https://github.com/mii443/usls.git
synced 2025-12-03 02:58:22 +00:00
Add onnx build script
This commit is contained in:
@@ -39,7 +39,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let feats_image = model.encode_images(&images).unwrap();
|
||||
|
||||
// use image to query texts
|
||||
let matrix = feats_image.dot2(&feats_text)?;
|
||||
let matrix = match feats_image.embedding() {
|
||||
Some(x) => x.dot2(feats_text.embedding().unwrap())?,
|
||||
None => continue,
|
||||
};
|
||||
|
||||
// summary
|
||||
for i in 0..paths.len() {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 134 KiB |
@@ -1,4 +1,4 @@
|
||||
use usls::{models::Dinov2, Options};
|
||||
use usls::{models::Dinov2, DataLoader, Options};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// build model
|
||||
@@ -7,8 +7,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.with_i00((1, 1, 1).into())
|
||||
.with_i02((224, 224, 224).into())
|
||||
.with_i03((224, 224, 224).into());
|
||||
let _model = Dinov2::new(options)?;
|
||||
println!("TODO...");
|
||||
let mut model = Dinov2::new(options)?;
|
||||
let x = vec![DataLoader::try_read("./examples/dinov2/images/1.jpg")?];
|
||||
let y = model.run(&x)?;
|
||||
println!("{y:?}");
|
||||
|
||||
// query from vector
|
||||
// let ys = model.query_from_vec(
|
||||
|
||||
Reference in New Issue
Block a user