summaryrefslogtreecommitdiff
path: root/candle-examples/examples/yolo-v3/main.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-09-08 19:11:34 +0100
committerGitHub <noreply@github.com>2023-09-08 19:11:34 +0100
commit0906acab9186fbb14a2268e12dd66c13b0877f3e (patch)
tree6263cd54d7ca3e91d72e62b81ab27908b27b760d /candle-examples/examples/yolo-v3/main.rs
parent158ff3c609b22ed998dea5283738cc1ed13aa592 (diff)
downloadcandle-0906acab9186fbb14a2268e12dd66c13b0877f3e.tar.gz
candle-0906acab9186fbb14a2268e12dd66c13b0877f3e.tar.bz2
candle-0906acab9186fbb14a2268e12dd66c13b0877f3e.zip
Automatic mask generation (#779)
* A few more contiguous fixes for cuda. * Mask generation. * Generic bbox. * Generate all the masks.
Diffstat (limited to 'candle-examples/examples/yolo-v3/main.rs')
-rw-r--r--candle-examples/examples/yolo-v3/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/candle-examples/examples/yolo-v3/main.rs b/candle-examples/examples/yolo-v3/main.rs
index 5e388921..20021b45 100644
--- a/candle-examples/examples/yolo-v3/main.rs
+++ b/candle-examples/examples/yolo-v3/main.rs
@@ -46,7 +46,7 @@ pub fn report(
let (npreds, pred_size) = pred.dims2()?;
let nclasses = pred_size - 5;
// The bounding boxes grouped by (maximum) class index.
- let mut bboxes: Vec<Vec<Bbox>> = (0..nclasses).map(|_| vec![]).collect();
+ let mut bboxes: Vec<Vec<Bbox<()>>> = (0..nclasses).map(|_| vec![]).collect();
// Extract the bounding boxes for which confidence is above the threshold.
for index in 0..npreds {
let pred = Vec::<f32>::try_from(pred.get(index)?)?;
@@ -65,7 +65,7 @@ pub fn report(
xmax: pred[0] + pred[2] / 2.,
ymax: pred[1] + pred[3] / 2.,
confidence,
- keypoints: vec![],
+ data: (),
};
bboxes[class_index].push(bbox)
}