-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy patherror.rs
More file actions
31 lines (30 loc) · 1.09 KB
/
Copy patherror.rs
File metadata and controls
31 lines (30 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//! The errors of the Yolo crate.
#[derive(thiserror::Error, Debug)]
pub enum YoloError {
#[error("build session: {0}")]
OrtSessionBuildError(ort::Error),
#[error("load session: {0}")]
OrtSessionLoadError(ort::Error),
#[error("load model: {0}")]
OrtInputError(ort::Error),
#[error("run inference: {0}")]
OrtInferenceError(ort::Error),
#[error("extract tensor: {0}")]
OrtExtractTensorError(ort::Error),
#[error("model has no inputs")]
MissingModelInput,
#[error("model has no outputs")]
MissingModelOutput,
#[error("unsupported model output shape {0:?}; expected a 3D detection tensor")]
InvalidOutputShape(Vec<usize>),
#[error(
"model output has {available} detection channels, but {required} are required for 4 box coordinates plus {label_count} labels"
)]
InsufficientDetectionChannels {
available: usize,
required: usize,
label_count: usize,
},
#[error("detected class index {class_id} is out of range for {label_count} labels")]
UnknownClassId { class_id: usize, label_count: usize },
}