Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/workspace deps #2

Merged
merged 3 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
[workspace]
members = ["infur", "infur-test-gen", "ff-video", "image-ext"]
default-members = ["infur"]
resolver = "2"

[workspace.package]
version = "0.2.0"
edition = "2021"
description = "ONNX model inference on video and images"
authors = ["Alexander Hirner"]
license = "MIT"
keywords = ["ONNX", "Neural Networks", "Inference", "Segmentation", "GUI", "Prediction", "Video"]
readme = "README.md"
repository = "https://github.com/ahirner/infur"
homepage = "https://github.com/ahirner/infur"

[workspace.dependencies]
image = "0.24"
fast_image_resize = { version = "1" }
# need onnxruntime .14 for 0-dim input tolerance (not in .13),
# then furthermore need master to resolve ndarray with tract-core
onnxruntime = { git = "https://github.com/nbigaouette/onnxruntime-rs" }
serde = { version = "1", features = ["derive"] }
thiserror = "1"
tracing = "0.1"

[profile.dev.package]
image-ext = { opt-level = 3 }
backtrace = { opt-level = 3 }
11 changes: 5 additions & 6 deletions ff-video/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "ff-video"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
description = "Slim image decoding with ffmpeg."
version.workspace = true
edition.workspace = true

[dependencies]
image-ext = { path = "../image-ext" }
thiserror = "1"
tracing = "0.1"
thiserror.workspace = true
tracing.workspace = true
6 changes: 3 additions & 3 deletions image-ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "image-ext"
version = "0.1.0"
edition = "2021"
description = "Extend image crate with BGR pixel type"
version.workspace = true
edition.workspace = true

[dependencies]
image = "0.24"
image.workspace = true
4 changes: 2 additions & 2 deletions infur-test-gen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "infur-test-gen"
version = "0.1.0"
edition = "2021"
description = "generate synthetic test media"
version.workspace = true
edition.workspace = true

[build-dependencies]
ureq = "2"
Expand Down
30 changes: 11 additions & 19 deletions infur/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
[package]
authors = ["Alexander Hirner <[email protected]>"]
license = "MIT"
name = "infur"
version = "0.1.0"
edition = "2021"
description = "ONNX model inference on video and images"
keywords = ["ONNX", "Neural Networks", "Inference", "Segmentation", "GUI", "Prediction", "Video"]
repository = "https://github.com/ahirner/infur"
readme = "README.md"
homepage = "https://github.com/ahirner/infur"
description.workspace = true
version.workspace = true
edition.workspace = true

[features]
default = ["persistence"]
persistence = ["eframe/persistence"]

[dependencies]
thiserror = "1"
stable-eyre = "0.2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["ansi", "env-filter", "fmt"], default-features = false }
eframe = { version = "0.19", features = ["wgpu", "default_fonts"], default-features = false}
serde = { version = "1", features = ["derive"] }
fast_image_resize = { version = "1" }
# need onnxruntime .14 for 0-dim input tolerance (not in .13),
# then furthermore need master to resolve ndarray with tract-core...
onnxruntime = { git = "https://github.com/nbigaouette/onnxruntime-rs" }
fast_image_resize.workspace = true
onnxruntime.workspace = true
thiserror.workspace = true
tracing.workspace = true
serde.workspace = true
once_cell = "1"
eframe = { version = "0.19", features = ["wgpu", "default_fonts"], default-features = false }
tracing-subscriber = { version = "0.3", features = ["ansi", "env-filter", "fmt"], default-features = false }
stable-eyre = "0.2"
image-ext = { path = "../image-ext" }
ff-video = { path = "../ff-video" }

Expand Down
2 changes: 1 addition & 1 deletion infur/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl eframe::App for InFur {
// occupy max width with constant aspect ratio
let max_width = ui.available_width();
let [w, h] = tex_frame.handle.size();
let w_scale = max_width as f32 / w as f32;
let w_scale = max_width / w as f32;
let (w, h) = (w as f32 * w_scale, h as f32 * w_scale);
ui.image(&tex_frame.handle, [w, h]);
// prop decoded image underneath
Expand Down