feat: Use the git version of mnn-rs with a patch to local
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1210,6 +1210,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "mnn-bridge"
|
name = "mnn-bridge"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/uttarayan21/mnn-rs?branch=restructure-tensor-type#6ce7bfda5a030afaca64f72d2e3040a9a3ae6b02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"error-stack",
|
"error-stack",
|
||||||
"mnn",
|
"mnn",
|
||||||
@@ -1219,6 +1220,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "mnn-sync"
|
name = "mnn-sync"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/uttarayan21/mnn-rs?branch=restructure-tensor-type#6ce7bfda5a030afaca64f72d2e3040a9a3ae6b02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"error-stack",
|
"error-stack",
|
||||||
"flume",
|
"flume",
|
||||||
|
|||||||
18
Cargo.toml
18
Cargo.toml
@@ -5,19 +5,23 @@ members = ["ndarray-image", "ndarray-resize", ".", "bounding-box"]
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
|
[patch."https://github.com/uttarayan21/mnn-rs"]
|
||||||
|
mnn = { path = "/Users/fs0c131y/Projects/aftershoot/mnn-rs" }
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
ndarray-image = { path = "ndarray-image" }
|
ndarray-image = { path = "ndarray-image" }
|
||||||
ndarray-resize = { path = "ndarray-resize" }
|
ndarray-resize = { path = "ndarray-resize" }
|
||||||
mnn = { path = "/home/servius/Projects/mnn-rs", version = "0.2.0", features = [
|
mnn = { git = "https://github.com/uttarayan21/mnn-rs", version = "0.2.0", features = [
|
||||||
"opencl",
|
"metal",
|
||||||
|
"coreml",
|
||||||
"tracing",
|
"tracing",
|
||||||
] }
|
], branch = "restructure-tensor-type" }
|
||||||
mnn-bridge = { path = "/home/servius/Projects/mnn-rs/mnn-bridge", version = "0.1.0", features = [
|
mnn-bridge = { git = "https://github.com/uttarayan21/mnn-rs", version = "0.1.0", features = [
|
||||||
"ndarray",
|
"ndarray",
|
||||||
] }
|
], branch = "restructure-tensor-type" }
|
||||||
mnn-sync = { path = "/home/servius/Projects/mnn-rs/mnn-sync", version = "0.1.0", features = [
|
mnn-sync = { git = "https://github.com/uttarayan21/mnn-rs", version = "0.1.0", features = [
|
||||||
"tracing",
|
"tracing",
|
||||||
] }
|
], branch = "restructure-tensor-type" }
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "detector"
|
name = "detector"
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ impl FaceDetection {
|
|||||||
model.set_session_mode(mnn::SessionMode::Release);
|
model.set_session_mode(mnn::SessionMode::Release);
|
||||||
let bc = mnn::BackendConfig::default().with_memory_mode(mnn::MemoryMode::High);
|
let bc = mnn::BackendConfig::default().with_memory_mode(mnn::MemoryMode::High);
|
||||||
let sc = mnn::ScheduleConfig::new()
|
let sc = mnn::ScheduleConfig::new()
|
||||||
.with_type(mnn::ForwardType::CPU)
|
.with_type(mnn::ForwardType::CoreML)
|
||||||
.with_backend_config(bc);
|
.with_backend_config(bc);
|
||||||
tracing::info!("Creating session handle for face detection model");
|
tracing::info!("Creating session handle for face detection model");
|
||||||
let handle = mnn_sync::SessionHandle::new(model, sc)
|
let handle = mnn_sync::SessionHandle::new(model, sc)
|
||||||
@@ -103,6 +103,7 @@ impl FaceDetection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn detect_faces(&self, image: ndarray::Array3<u8>) -> Result<FaceDetectionModelOutput> {
|
pub fn detect_faces(&self, image: ndarray::Array3<u8>) -> Result<FaceDetectionModelOutput> {
|
||||||
|
#[rustfmt::skip]
|
||||||
use ::tap::*;
|
use ::tap::*;
|
||||||
let output = self
|
let output = self
|
||||||
.handle
|
.handle
|
||||||
|
|||||||
Reference in New Issue
Block a user