Skip to content

Commit

Permalink
Update ORT dependency and adjust image handling setup
Browse files Browse the repository at this point in the history
- Update `ort` dependencies and adjust related module imports to reflect new paths.
- Refactor image processing session handling for better compatibility with `ort` changes.
- Enhance security policies in the configuration to support new image sources and connection protocols.
  • Loading branch information
zhongweili committed Dec 15, 2024
1 parent 931de63 commit 058d844
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tauri-plugin-process = "2"
tauri-plugin-shell = "2"
tauri-plugin-window-state = "2.0.1"
tracing = { version = "0.1.40", features = ["log"] }
ort = { version = "2.0.0-rc.8" }
ort = { version = "2.0.0-rc.9" }
image = "0.25.4"
ndarray = "0.16.1"
half = "2.3"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/image/model.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use image::DynamicImage;
use ort::{inputs, GraphOptimizationLevel, Session, Value};
use ort::{inputs, session::builder::GraphOptimizationLevel, session::Session, value::Value};
use std::marker::PhantomData;

use crate::image::error::ImageProcessingError;
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/image/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::marker::PhantomData;
use super::{ImageModel, ImageProcessingError};

pub struct ModelProcessor<M: ImageModel + Send + Sync> {
session: ort::Session,
session: ort::session::Session,
_phantom: PhantomData<M>,
}

Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/image/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub trait NumericType:
+ Send
+ Sync
+ std::fmt::Debug
+ ort::IntoTensorElementType
+ ort::PrimitiveTensorElementType
// + ort::IntoTensorElementType
// + ort::PrimitiveTensorElementType
+ 'static
{
fn from_f32(v: f32) -> Self;
Expand Down
6 changes: 3 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"windows": [],
"security": {
"csp": {
"default-src": "'self'",
"style-src": "'self' 'unsafe-inline'",
"img-src": "'self' asset: https://raw.githubusercontent.com data:",
"connect-src": "'self' ipc: https://api.github.com",
"img-src": "'self' asset: http://asset.localhost https://raw.githubusercontent.com blob: data:",
"default-src": "'self' asset:",
"connect-src": "'self' tauri: http://tauri.localhost ipc: http://ipc.localhost http://localhost:8023 ipc: https://api.github.com",
"script-src": "'self'"
},
"assetProtocol": {
Expand Down

0 comments on commit 058d844

Please sign in to comment.