MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / __init__

Method __init__

flow-python/examples/application/cat_finder/det.py:20–36  ·  view source on GitHub ↗
(self, name, args)

Source from the content-addressed store, hash-verified

18@register(inputs=['inp'], outputs=['out'])
19class Detect:
20 def __init__(self, name, args):
21 logger.info("loading YOLOX detection...")
22 self._tsize = args['tsize']
23 self._interval = args['interval']
24 self._visualize = args['visualize']
25 self.name = name
26
27 # load detect model and warmup
28 self._predictor = PredictorLite(path=args['path'],
29 confthre=args['conf'],
30 nmsthre=args['nms'],
31 test_size=(self._tsize, self._tsize),
32 device=args['device'],
33 device_id=args['device_id'])
34 warmup_data = np.zeros((224, 224, 3), dtype=np.uint8)
35 self._predictor.inference(warmup_data)
36 logger.info(" YOLOX loaded.")
37
38 @staticmethod
39 def restrict(val, min, max):

Callers

nothing calls this directly

Calls 3

PredictorLiteClass · 0.90
infoMethod · 0.45
inferenceMethod · 0.45

Tested by

no test coverage detected