File size: 1,141 Bytes
cf8c8d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Shared folder layout.

Everything this toolkit writes lives under one work directory (default: ``<repo>/data``, which is
git-ignored). Override the whole tree with ``OCR_WORK_DIR`` or any single folder with its own variable:

    OCR_WORK_DIR      root of all outputs                  default <repo>/data
    OCR_MODELS_DIR    downloaded weights                   default $OCR_WORK_DIR/models
    OCR_UPSTREAM_DIR  official code checked out at a pin   default $OCR_WORK_DIR/upstream
    OCR_PREPARED_DIR  converted training data              default $OCR_WORK_DIR/prepared
    OCR_RUNS_DIR      checkpoints, predictions, scores     default $OCR_WORK_DIR/runs
"""
import os
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[1]
WORK_DIR = Path(os.environ.get("OCR_WORK_DIR", str(REPO_ROOT / "data")))
MODELS_DIR = Path(os.environ.get("OCR_MODELS_DIR", str(WORK_DIR / "models")))
UPSTREAM_DIR = Path(os.environ.get("OCR_UPSTREAM_DIR", str(WORK_DIR / "upstream")))
PREPARED_DIR = Path(os.environ.get("OCR_PREPARED_DIR", str(WORK_DIR / "prepared")))
RUNS_DIR = Path(os.environ.get("OCR_RUNS_DIR", str(WORK_DIR / "runs")))