stamp_parser.py 571 B

12345678910111213141516
  1. import fastdeploy as fd
  2. from utils.time import timeit
  3. d_option = fd.RuntimeOption()
  4. d_option.use_cpu()
  5. d_model = fd.vision.detection.YOLOv3('./models/detection_models/model.pdmodel',
  6. "./models/detection_models/model.pdiparams",
  7. "./models/detection_models/infer_cfg.yml",
  8. runtime_option=d_option)
  9. @timeit
  10. def d_stamp(img):
  11. result = d_model.predict(img.copy())
  12. print(result.scores)
  13. return next(('True' for i in result.scores if i > 0.1), 'False')