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