未验证 提交 904e6c81 编写于 作者: W Wanli 提交者: GitHub

fix bugs in wechatQRcode (#153)

上级 afc67194
......@@ -28,13 +28,13 @@ parser = argparse.ArgumentParser(
description="WeChat QR code detector for detecting and parsing QR code (https://github.com/opencv/opencv_contrib/tree/master/modules/wechat_qrcode)")
parser.add_argument('--input', '-i', type=str,
help='Usage: Set path to the input image. Omit for using default camera.')
parser.add_argument('--detect_prototxt_path', type=str, default='detect_2021sep.prototxt',
parser.add_argument('--detect_prototxt_path', type=str, default='detect_2021nov.prototxt',
help='Usage: Set path to detect.prototxt.')
parser.add_argument('--detect_model_path', type=str, default='detect_2021sep.caffemodel',
parser.add_argument('--detect_model_path', type=str, default='detect_2021nov.caffemodel',
help='Usage: Set path to detect.caffemodel.')
parser.add_argument('--sr_prototxt_path', type=str, default='sr_2021sep.prototxt',
parser.add_argument('--sr_prototxt_path', type=str, default='sr_2021nov.prototxt',
help='Usage: Set path to sr.prototxt.')
parser.add_argument('--sr_model_path', type=str, default='sr_2021sep.caffemodel',
parser.add_argument('--sr_model_path', type=str, default='sr_2021nov.caffemodel',
help='Usage: Set path to sr.caffemodel.')
parser.add_argument('--backend_target', '-bt', type=int, default=0,
help='''Choose one of the backend-target pair to run this demo:
......
......@@ -15,7 +15,7 @@ class WeChatQRCode:
sr_prototxt_path,
sr_model_path
)
if backendId != 0:
if backendId != 0 and backendId != 3:
raise NotImplementedError("Backend {} is not supported by cv.wechat_qrcode_WeChatQRCode()".format(backendId))
if targetId != 0:
raise NotImplementedError("Target {} is not supported by cv.wechat_qrcode_WeChatQRCode()")
......@@ -25,7 +25,7 @@ class WeChatQRCode:
return self.__class__.__name__
def setBackendAndTarget(self, backendId, targetId):
if backendId != 0:
if backendId != 0 and backendId != 3:
raise NotImplementedError("Backend {} is not supported by cv.wechat_qrcode_WeChatQRCode()".format(backendId))
if targetId != 0:
raise NotImplementedError("Target {} is not supported by cv.wechat_qrcode_WeChatQRCode()")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册