MCPcopy Create free account
hub / github.com/FeiYull/TensorRT-Alpha / __init__

Method __init__

examples/python_with_dll/python_trt.py:11–25  ·  view source on GitHub ↗
(
            self, dll_path, trt_path, window_width=640, window_height=640, conf_thresh=0.25, iou_thresh=0.45,
            num_class=80)

Source from the content-addressed store, hash-verified

9
10class Detector:
11 def __init__(
12 self, dll_path, trt_path, window_width=640, window_height=640, conf_thresh=0.25, iou_thresh=0.45,
13 num_class=80):
14 self.yolo = CDLL(dll_path)
15 self.max_bbox = 50
16
17 self.yolo.Detect.argtypes = [c_void_p, c_int, c_int, POINTER(c_ubyte),
18 npct.ndpointer(dtype=np.float32, ndim=2, shape=(self.max_bbox, 6),
19 flags="C_CONTIGUOUS")]
20
21 self.yolo.Init.argtypes = [c_char_p, c_int, c_int, c_float, c_float, c_int]
22 self.yolo.Init.restype = c_void_p
23
24 self.c_point = self.yolo.Init(trt_path.encode('utf-8'), window_width, window_height, conf_thresh, iou_thresh,
25 num_class)
26
27 def predict(self, img):
28 rows, cols = img.shape[0], img.shape[1]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected