Skip to content

About a class that can support both PyTorch Model and ONNX model #3

@curtis18

Description

@curtis18

Thank you for your tutorial. I would like to ask can the output of boxes and masks from ONNX model be the same as the output of PyTorch model? So that a classs can be created to support both ONNX and PyTorch model output?

                # YOLO
                results = self.model.predict(source=image, device=device)
                boxes = results[0].boxes.data.cpu().numpy()
                masks = results[0].masks.data.cpu().numpy() if results[0].masks else None
                # ONNX
                outputs = self.model.run(None, {input_name: image_np})
                boxes, masks = self.model_onnx_seg_convert(outputs)  # a new function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions