yolov5_instance_segmentation
YOLOv5InstanceSegmentation
¶
Bases: InstanceSegmentationBaseOnnxRoboflowInferenceModel
YOLOv5 Instance Segmentation ONNX Inference Model.
This class is responsible for performing instance segmentation using the YOLOv5 model with ONNX runtime.
Attributes:
Name | Type | Description |
---|---|---|
weights_file |
str
|
Path to the ONNX weights file. |
Source code in inference/models/yolov5/yolov5_instance_segmentation.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
weights_file: str
property
¶
Gets the weights file for the YOLOv5 model.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Path to the ONNX weights file. |
predict(img_in, **kwargs)
¶
Performs inference on the given image using the ONNX session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img_in
|
ndarray
|
Input image as a NumPy array. |
required |
Returns:
Type | Description |
---|---|
Tuple[ndarray, ndarray]
|
Tuple[np.ndarray, np.ndarray]: Tuple containing two NumPy arrays representing the predictions. |
Source code in inference/models/yolov5/yolov5_instance_segmentation.py
29 30 31 32 33 34 35 36 37 38 39 |
|