allow environment variable for BASE_DIR models (#14678)
* allow environment variable for BASE_DIR models * add doc for environment variable PADDLE_OCR_BASE_DIR * fix code style errorpull/14686/head
parent
500e1a78cb
commit
44e17bae0a
|
@ -24,6 +24,10 @@ hide:
|
|||
python -m pip install paddlepaddle-gpu==3.0.0rc1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
|
||||
```
|
||||
|
||||
You can customize the storage location for OCR models by setting the environment variable `PADDLE_OCR_BASE_DIR`. If this variable is not set, the models will be downloaded to the following default locations:
|
||||
- On Linux/macOS: `${HOME}/.paddleocr`
|
||||
- On Windows: `C:\Users\{username}\.paddleocr`
|
||||
|
||||
### Use by code
|
||||
|
||||
=== "Detection + Classification + Recognition"
|
||||
|
|
|
@ -85,7 +85,7 @@ __all__ = [
|
|||
|
||||
SUPPORT_DET_MODEL = ["DB"]
|
||||
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"]
|
||||
|
|
Loading…
Reference in New Issue