yolov10_object_detection
YOLOv10ObjectDetection
¶
Bases: ObjectDetectionBaseOnnxRoboflowInferenceModel
Roboflow ONNX Object detection model (Implements an object detection specific infer method).
This class is responsible for performing object detection using the YOLOv10 model with ONNX runtime.
Attributes:
Name | Type | Description |
---|---|---|
weights_file |
str
|
Path to the ONNX weights file. |
Methods:
Name | Description |
---|---|
predict |
Performs object detection on the given image using the ONNX session. |
Source code in inference/models/yolov10/yolov10_object_detection.py
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
weights_file: str
property
¶
Gets the weights file for the YOLOv10 model.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Path to the ONNX weights file. |
postprocess(predictions, preproc_return_metadata, confidence=DEFAULT_CONFIDENCE, max_detections=DEFAUlT_MAX_DETECTIONS, **kwargs)
¶
Postprocesses the object detection predictions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
predictions
|
ndarray
|
Raw predictions from the model. |
required |
img_dims
|
List[Tuple[int, int]]
|
Dimensions of the images. |
required |
confidence
|
float
|
Confidence threshold for filtering detections. Default is 0.5. |
DEFAULT_CONFIDENCE
|
max_detections
|
int
|
Maximum number of final detections. Default is 300. |
DEFAUlT_MAX_DETECTIONS
|
Returns:
Type | Description |
---|---|
List[ObjectDetectionInferenceResponse]
|
List[ObjectDetectionInferenceResponse]: The post-processed predictions. |
Source code in inference/models/yolov10/yolov10_object_detection.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
predict(img_in, **kwargs)
¶
Performs object detection 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]
|
Tuple[np.ndarray]: NumPy array representing the predictions, including boxes, confidence scores, and class confidence scores. |
Source code in inference/models/yolov10/yolov10_object_detection.py
38 39 40 41 42 43 44 45 46 47 48 49 |
|