Trait BasePredictor
Source pub trait BasePredictor {
type Result;
type Error;
// Required methods
fn process(
&self,
batch_data: BatchData,
) -> Result<Self::Result, Self::Error>;
fn convert_to_prediction_result(
&self,
result: Self::Result,
) -> PredictionResult<'static>;
fn batch_sampler(&self) -> &BatchSampler;
fn model_name(&self) -> &str;
fn predictor_type_name(&self) -> &str;
}
Expand description
Trait for base predictors in the OCR pipeline.
This trait defines the interface for base predictors that process batch data.
The result type of this predictor.
The error type of this predictor.
Processes the given batch data.
§Arguments
batch_data - The batch data to process.
§Returns
A Result containing the processing result or an error.
Converts the processing result to a prediction result.
§Arguments
result - The processing result to convert.
§Returns
The converted prediction result.
Gets the batch sampler used by this predictor.
§Returns
A reference to the batch sampler.
Gets the name of the model used by this predictor.
§Returns
The name of the model.
Gets the type name of this predictor.
§Returns
The type name of the predictor.