Method
__init__
(
self,
checkpoint,
device="cuda",
threshold_conf=0.05,
threshold_multi_persons=0.1,
input_resolution=(640, 640),
threshold_iou=0.5,
threshold_bbox_shape_ratio=0.4,
cat_id=[1],
select_type="max",
strict=True,
sorted_func=None,
**kwargs,
)
Source from the content-addressed store, hash-verified
| 54 | |
| 55 | class Yolo(SimpleOnnxInference): |
| 56 | def __init__( |
| 57 | self, |
| 58 | checkpoint, |
| 59 | device="cuda", |
| 60 | threshold_conf=0.05, |
| 61 | threshold_multi_persons=0.1, |
| 62 | input_resolution=(640, 640), |
| 63 | threshold_iou=0.5, |
| 64 | threshold_bbox_shape_ratio=0.4, |
| 65 | cat_id=[1], |
| 66 | select_type="max", |
| 67 | strict=True, |
| 68 | sorted_func=None, |
| 69 | **kwargs, |
| 70 | ): |
| 71 | super(Yolo, self).__init__(checkpoint, device=device, **kwargs) |
| 72 | |
| 73 | model_inputs = self.session.get_inputs() |
| 74 | input_shape = model_inputs[0].shape |
| 75 | |
| 76 | self.input_width = 640 |
| 77 | self.input_height = 640 |
| 78 | |
| 79 | self.threshold_multi_persons = threshold_multi_persons |
| 80 | self.threshold_conf = threshold_conf |
| 81 | self.threshold_iou = threshold_iou |
| 82 | self.threshold_bbox_shape_ratio = threshold_bbox_shape_ratio |
| 83 | self.input_resolution = input_resolution |
| 84 | self.cat_id = cat_id |
| 85 | self.select_type = select_type |
| 86 | self.strict = strict |
| 87 | self.sorted_func = sorted_func |
| 88 | |
| 89 | def preprocess(self, input_image): |
| 90 | """ |
Tested by
no test coverage detected