Does this crate support ncnn?
question
### Search before asking
- [x] I have searched the Ultralytics [issues](https://github.com/ultralytics/PROJECT_NAME/issues) and [discussions](https://github.com/orgs/ultralytics/discussions) and found no similar questions.
### Question
I have this code:
```rs
use ultralytics_inference::{YOLOModel, InferenceConfig};
fn main()
{
// Load your custom NCNN model (auto-detects format)
let mut model = YOLOModel::load("custom_ncnn_model/").unwrap();
// Configure exactly like Python predict params
let mut config = InferenceConfig::default();
config.confidence_threshold = 0.6; // Confidence threshold
//config. = true; // Real-time display window
//config.line_thickness = 2; // Box line thickness
config.save = false; // No output saving
//config.stream = true; // Process video frame-by-frame
// Run prediction (handles video streaming + visualization automatically)
//model.predict_config("video.mp4", config);
model.predict("video.mp4").unwrap();
}
```
However I get this error:
```cmd
thread 'main' (100562) panicked at src/main.rs:6:59:
called `Result::unwrap()` on an `Err` value: ModelLoadError("Failed to load model: Load model from custom_ncnn_model/ failed:Protobuf parsing failed.")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Doesn't this crate support `ncnn` models? Do I _have_ to use `onnx` instead?
### Additional
_No response_
关闭于 2026-01-18 4 条评论