diff --git a/tools/export_model.py b/tools/export_model.py index 785aca10e46200bda49bdff2b89ba00cafbe7a20..cae87aca129134d64711e364bf10428d69500a06 100755 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -93,6 +93,9 @@ def main(): for key in config["Architecture"]["Models"]: config["Architecture"]["Models"][key]["Head"][ "out_channels"] = char_num + # just one final tensor needs to to exported for inference + config["Architecture"]["Models"][key][ + "return_all_feats"] = False else: # base rec model config["Architecture"]["Head"]["out_channels"] = char_num model = build_model(config["Architecture"]) diff --git a/tools/infer_rec.py b/tools/infer_rec.py index 09f5a0c767b15c312cdfbe8ed695ea06bdc8cdc4..cf49348fa61be2e1ee2523f3fb9224df5d4990f2 100755 --- a/tools/infer_rec.py +++ b/tools/infer_rec.py @@ -121,7 +121,7 @@ def main(): if len(post_result[key][0]) >= 2: rec_info[key] = { "label": post_result[key][0][0], - "score": post_result[key][0][1], + "score": float(post_result[key][0][1]), } info = json.dumps(rec_info) else: