We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ae3d8b commit 78e55daCopy full SHA for 78e55da
ocrs/src/detection.rs
@@ -172,18 +172,9 @@ impl TextDetector {
172
173
// Run text detection model to compute a probability mask indicating whether
174
// 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
- )?;
+ let mut opts = RunOptions::default();
+ opts.timing = debug;
+ let text_mask: Tensor<f32> = self.model.run(image.view(), Some(opts))?;
187
188
// Resize probability mask to original input size and apply threshold to get a
189
// binary text/not-text mask.
0 commit comments