From 904e6c8156a895dff6363fdecd25885b1324d8a8 Mon Sep 17 00:00:00 2001 From: Wanli Date: Thu, 30 Mar 2023 14:40:57 +0800 Subject: [PATCH] fix bugs in wechatQRcode (#153) --- models/qrcode_wechatqrcode/demo.py | 8 ++++---- models/qrcode_wechatqrcode/wechatqrcode.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/models/qrcode_wechatqrcode/demo.py b/models/qrcode_wechatqrcode/demo.py index 1f4821d..745f993 100644 --- a/models/qrcode_wechatqrcode/demo.py +++ b/models/qrcode_wechatqrcode/demo.py @@ -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: diff --git a/models/qrcode_wechatqrcode/wechatqrcode.py b/models/qrcode_wechatqrcode/wechatqrcode.py index 3b0432e..95c98be 100644 --- a/models/qrcode_wechatqrcode/wechatqrcode.py +++ b/models/qrcode_wechatqrcode/wechatqrcode.py @@ -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()") -- GitLab