12345678910111213141516 |
- import fastdeploy as fd
- from utils.time import timeit
- d_option = fd.RuntimeOption()
- d_option.use_cpu()
- d_model = fd.vision.detection.YOLOv3('./models/detection_models/model.pdmodel',
- "./models/detection_models/model.pdiparams",
- "./models/detection_models/infer_cfg.yml",
- runtime_option=d_option)
- @timeit
- def d_stamp(img):
- result = d_model.predict(img.copy())
- print(result.scores)
- return next(('True' for i in result.scores if i > 0.1), 'False')
|