TextModel.py 453 B

12345678910111213141516
  1. from textbbx import net,imgproc,test_net,args,refine_net,getResult
  2. import os,cv2
  3. from DeepModel import DeePredict
  4. def text_model(image_path):
  5. image = imgproc.loadImage(image_path)
  6. bboxes, polys, score_text = test_net(net, image, args.text_threshold, args.link_threshold, args.low_text,
  7. args.cuda, args.poly, refine_net)
  8. return getResult(polys)
  9. # print(text_model(r"D:\试卷切割\img\5.png"))