stamp_parser.py 535 B

12345678910111213141516
  1. import fastdeploy as fd
  2. from sx_utils.sxtime import sxtimeit
  3. d_option = fd.RuntimeOption()
  4. d_option.use_cpu()
  5. d_model = fd.vision.detection.YOLOv3('./d_models/model.pdmodel',
  6. "./d_models/model.pdiparams",
  7. "./d_models/infer_cfg.yml",
  8. runtime_option=d_option)
  9. @sxtimeit
  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')