test.py 782 B

12345678910111213141516171819202122
  1. from hitCaptcha.detect.yolo import YOLO
  2. import PIL
  3. if __name__=="__main__":
  4. YL = YOLO()
  5. list_anno = []
  6. with open("detectVal.txt","r") as f:
  7. while True:
  8. _line = f.readline()
  9. if not _line:
  10. break
  11. _line = _line.split(" ")
  12. list_anno.append([_line[0],_line[1]])
  13. img_path = "F:\Workspace2016\BIDI_CAPTCHA\hitCaptcha\detect/data/ab6ee72e4bb142678f2e3fd66e294209.jpg"
  14. img_path1 = "F:\Workspace2016\BIDI_CAPTCHA\hitCaptcha\detect/data/f722335f224c4b698b8470d0582b649e.jpg"
  15. for img_path,img_path1 in list_anno:
  16. image = PIL.Image.open(img_path)
  17. image1 = PIL.Image.open(img_path1)
  18. YL.detect_image(img_path,(352,352),img_path1,(40,20))
  19. # image.show()
  20. # break