#!/bin/bash
set -e

: "${REC_CONFIG:=configs/rec/PP-OCRv5/PP-OCRv5_server_rec.yml}"
: "${CHECKPOINT:=../../output/train/rec_product/best_accuracy}"
: "${OUT_DIR:=../../models/paddle/product_rec}"
: "${DICT_PATH:=../../train_data/japanese_ocr/dict/ppocr_japanese_product_dict.txt}"

python tools/export_model.py \
  -c "${REC_CONFIG}" \
  -o Global.checkpoints="${CHECKPOINT}" \
     Global.save_inference_dir="${OUT_DIR}" \
     Global.character_dict_path="${DICT_PATH}" \
     Global.use_space_char=True
