Skip to content

Commit 78e55da

Browse files
committed
Avoid using struct expression to construct RunOptions
This change is for compatibility with the next rten release. See robertknight/rten#1008.
1 parent 9ae3d8b commit 78e55da

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

ocrs/src/detection.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,9 @@ impl TextDetector {
172172

173173
// Run text detection model to compute a probability mask indicating whether
174174
// each pixel is part of a text word or not.
175-
let text_mask: Tensor<f32> = self.model.run(
176-
image.view(),
177-
if debug {
178-
Some(RunOptions {
179-
timing: true,
180-
verbose: false,
181-
..Default::default()
182-
})
183-
} else {
184-
None
185-
},
186-
)?;
175+
let mut opts = RunOptions::default();
176+
opts.timing = debug;
177+
let text_mask: Tensor<f32> = self.model.run(image.view(), Some(opts))?;
187178

188179
// Resize probability mask to original input size and apply threshold to get a
189180
// binary text/not-text mask.

0 commit comments

Comments
 (0)