Skip to main content

postprocess

Function postprocess 

Source
pub fn postprocess(
    outputs: Vec<(&[f32], Vec<usize>)>,
    task: Task,
    preprocess: &PreprocessResult,
    config: &InferenceConfig,
    names: &HashMap<usize, String>,
    orig_img: Array3<u8>,
    path: String,
    speed: Speed,
    inference_shape: (u32, u32),
    end2end: bool,
    kpt_shape: Option<(usize, usize)>,
) -> Results
Expand description

Post-process raw model output based on task type.

§Arguments

  • outputs - Vector of raw model outputs (data, shape).
  • task - The task type (detect, segment, pose, etc.).
  • preprocess - Preprocessing result containing scale/padding info.
  • config - Inference configuration.
  • names - Class ID to name mapping.
  • orig_img - Original image as HWC array.
  • path - Source image path.
  • speed - Timing information.
  • inference_shape - The inference tensor shape (height, width) after letterboxing.

§Returns

Processed Results object.