pub trait TextRecognitionModelTrait: ModelTrait + TextRecognitionModelTraitConst {
// Required method
fn as_raw_mut_TextRecognitionModel(&mut self) -> *mut c_void;
// Provided methods
fn set_decode_type(
&mut self,
decode_type: &str,
) -> Result<TextRecognitionModel> { ... }
fn set_decode_opts_ctc_prefix_beam_search(
&mut self,
beam_size: i32,
voc_prune_size: i32,
) -> Result<TextRecognitionModel> { ... }
fn set_decode_opts_ctc_prefix_beam_search_def(
&mut self,
beam_size: i32,
) -> Result<TextRecognitionModel> { ... }
fn set_vocabulary(
&mut self,
vocabulary: &Vector<String>,
) -> Result<TextRecognitionModel> { ... }
}
Expand description
Mutable methods for crate::dnn::TextRecognitionModel
Required Methods§
fn as_raw_mut_TextRecognitionModel(&mut self) -> *mut c_void
Provided Methods§
Sourcefn set_decode_type(&mut self, decode_type: &str) -> Result<TextRecognitionModel>
fn set_decode_type(&mut self, decode_type: &str) -> Result<TextRecognitionModel>
Set the decoding method of translating the network output into string
§Parameters
- decodeType: The decoding method of translating the network output into string, currently supported type:
"CTC-greedy"
greedy decoding for the output of CTC-based methods"CTC-prefix-beam-search"
Prefix beam search decoding for the output of CTC-based methods
Sourcefn set_decode_opts_ctc_prefix_beam_search(
&mut self,
beam_size: i32,
voc_prune_size: i32,
) -> Result<TextRecognitionModel>
fn set_decode_opts_ctc_prefix_beam_search( &mut self, beam_size: i32, voc_prune_size: i32, ) -> Result<TextRecognitionModel>
Set the decoding method options for "CTC-prefix-beam-search"
decode usage
§Parameters
- beamSize: Beam size for search
- vocPruneSize: Parameter to optimize big vocabulary search, only take top @p vocPruneSize tokens in each search step, @p vocPruneSize <= 0 stands for disable this prune.
§C++ default parameters
- voc_prune_size: 0
Sourcefn set_decode_opts_ctc_prefix_beam_search_def(
&mut self,
beam_size: i32,
) -> Result<TextRecognitionModel>
fn set_decode_opts_ctc_prefix_beam_search_def( &mut self, beam_size: i32, ) -> Result<TextRecognitionModel>
Set the decoding method options for "CTC-prefix-beam-search"
decode usage
§Parameters
- beamSize: Beam size for search
- vocPruneSize: Parameter to optimize big vocabulary search, only take top @p vocPruneSize tokens in each search step, @p vocPruneSize <= 0 stands for disable this prune.
§Note
This alternative version of TextRecognitionModelTrait::set_decode_opts_ctc_prefix_beam_search function uses the following default values for its arguments:
- voc_prune_size: 0
Sourcefn set_vocabulary(
&mut self,
vocabulary: &Vector<String>,
) -> Result<TextRecognitionModel>
fn set_vocabulary( &mut self, vocabulary: &Vector<String>, ) -> Result<TextRecognitionModel>
Set the vocabulary for recognition.
§Parameters
- vocabulary: the associated vocabulary of the network.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.