Skip to content

Commit 058d844

Browse files
committed
Update ORT dependency and adjust image handling setup
- 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.
1 parent 931de63 commit 058d844

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src-tauri/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ tauri-plugin-process = "2"
3535
tauri-plugin-shell = "2"
3636
tauri-plugin-window-state = "2.0.1"
3737
tracing = { version = "0.1.40", features = ["log"] }
38-
ort = { version = "2.0.0-rc.8" }
38+
ort = { version = "2.0.0-rc.9" }
3939
image = "0.25.4"
4040
ndarray = "0.16.1"
4141
half = "2.3"

src-tauri/src/image/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use image::DynamicImage;
2-
use ort::{inputs, GraphOptimizationLevel, Session, Value};
2+
use ort::{inputs, session::builder::GraphOptimizationLevel, session::Session, value::Value};
33
use std::marker::PhantomData;
44

55
use crate::image::error::ImageProcessingError;

src-tauri/src/image/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::marker::PhantomData;
55
use super::{ImageModel, ImageProcessingError};
66

77
pub struct ModelProcessor<M: ImageModel + Send + Sync> {
8-
session: ort::Session,
8+
session: ort::session::Session,
99
_phantom: PhantomData<M>,
1010
}
1111

src-tauri/src/image/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ pub trait NumericType:
4242
+ Send
4343
+ Sync
4444
+ std::fmt::Debug
45-
+ ort::IntoTensorElementType
46-
+ ort::PrimitiveTensorElementType
45+
// + ort::IntoTensorElementType
46+
// + ort::PrimitiveTensorElementType
4747
+ 'static
4848
{
4949
fn from_f32(v: f32) -> Self;

src-tauri/tauri.conf.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"windows": [],
2525
"security": {
2626
"csp": {
27-
"default-src": "'self'",
2827
"style-src": "'self' 'unsafe-inline'",
29-
"img-src": "'self' asset: https://raw.githubusercontent.com data:",
30-
"connect-src": "'self' ipc: https://api.github.com",
28+
"img-src": "'self' asset: http://asset.localhost https://raw.githubusercontent.com blob: data:",
29+
"default-src": "'self' asset:",
30+
"connect-src": "'self' tauri: http://tauri.localhost ipc: http://ipc.localhost http://localhost:8023 ipc: https://api.github.com",
3131
"script-src": "'self'"
3232
},
3333
"assetProtocol": {

0 commit comments

Comments
 (0)