Skip to content

Commit

Permalink
Use a configurable Base Directory - issue PaddlePaddle#11145
Browse files Browse the repository at this point in the history
Instead of hardcoding the BASE_DIR in the code, I made it configurable by means of an environment variable:
  • Loading branch information
gknor authored and gknor-edrone committed Sep 9, 2024
1 parent 606e4f0 commit ca43330
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddleocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _import_file(module_name, file_path, make_importable=False):
SUPPORT_DET_MODEL = ['DB']
VERSION = '2.7.0.3'
SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']
BASE_DIR = os.path.expanduser("~/.paddleocr/")
BASE_DIR = os.environ.get('PADDLE_OCR_BASE_DIR', os.path.expanduser("~/.paddleocr/"))

DEFAULT_OCR_MODEL_VERSION = 'PP-OCRv4'
SUPPORT_OCR_MODEL_VERSION = ['PP-OCR', 'PP-OCRv2', 'PP-OCRv3', 'PP-OCRv4']
Expand Down

0 comments on commit ca43330

Please sign in to comment.