fix infer error model path
Browse files- infer_axmodel.py +7 -7
infer_axmodel.py
CHANGED
|
@@ -533,9 +533,9 @@ def text_recognizer(session,img_list,shape=[3,48,320],character_dict_path=r"./pp
|
|
| 533 |
def init_args():
|
| 534 |
parser = argparse.ArgumentParser()
|
| 535 |
parser.add_argument("--img_path",type=str,default=str(r"./11.jpg"),help="Path to input image.")
|
| 536 |
-
parser.add_argument("--det_model_dir",type=str,default=str(r"./ax650/
|
| 537 |
-
parser.add_argument("--rec_model_dir",type=str,default=str(r"./ax650/
|
| 538 |
-
parser.add_argument("--cls_model_dir",type=str,default=str(r"./ax650/
|
| 539 |
parser.add_argument("--character_dict_path",type=str,default=str(r"./ppocrv5_dict.txt"),help="recognition dictionary")
|
| 540 |
parser.add_argument("--det_limit_side_len", type=float, default=[960,960],help="detection model input size")
|
| 541 |
parser.add_argument("--rec_image_shape", type=str, default=[3, 48, 320],help="recognition model input size")
|
|
@@ -544,9 +544,9 @@ def init_args():
|
|
| 544 |
return parser.parse_args()
|
| 545 |
|
| 546 |
def main(args):
|
| 547 |
-
det_session = ort.InferenceSession(args.det_model_dir
|
| 548 |
-
rec_session = ort.InferenceSession(args.rec_model_dir
|
| 549 |
-
cls_session = ort.InferenceSession(args.cls_model_dir
|
| 550 |
|
| 551 |
image=cv2.imread(args.img_path)
|
| 552 |
|
|
@@ -584,4 +584,4 @@ def main(args):
|
|
| 584 |
|
| 585 |
if __name__=='__main__':
|
| 586 |
args=init_args()
|
| 587 |
-
main(args)
|
|
|
|
| 533 |
def init_args():
|
| 534 |
parser = argparse.ArgumentParser()
|
| 535 |
parser.add_argument("--img_path",type=str,default=str(r"./11.jpg"),help="Path to input image.")
|
| 536 |
+
parser.add_argument("--det_model_dir",type=str,default=str(r"./ax650/det_npu3.axmodel"),help="Path to detection model.")
|
| 537 |
+
parser.add_argument("--rec_model_dir",type=str,default=str(r"./ax650/rec_npu3.axmodel"),help="Path to recognition model.")
|
| 538 |
+
parser.add_argument("--cls_model_dir",type=str,default=str(r"./ax650/cls_npu3.axmodel"),help="Path to classification model.")
|
| 539 |
parser.add_argument("--character_dict_path",type=str,default=str(r"./ppocrv5_dict.txt"),help="recognition dictionary")
|
| 540 |
parser.add_argument("--det_limit_side_len", type=float, default=[960,960],help="detection model input size")
|
| 541 |
parser.add_argument("--rec_image_shape", type=str, default=[3, 48, 320],help="recognition model input size")
|
|
|
|
| 544 |
return parser.parse_args()
|
| 545 |
|
| 546 |
def main(args):
|
| 547 |
+
det_session = ort.InferenceSession(args.det_model_dir)
|
| 548 |
+
rec_session = ort.InferenceSession(args.rec_model_dir)
|
| 549 |
+
cls_session = ort.InferenceSession(args.cls_model_dir)
|
| 550 |
|
| 551 |
image=cv2.imread(args.img_path)
|
| 552 |
|
|
|
|
| 584 |
|
| 585 |
if __name__=='__main__':
|
| 586 |
args=init_args()
|
| 587 |
+
main(args)
|