Skip to content

Commit

Permalink
add asssert msg for local data env
Browse files Browse the repository at this point in the history
  • Loading branch information
kzorina committed Oct 25, 2024
1 parent 580b1cd commit 66ebb7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion happypose/pose_estimators/cosypose/cosypose/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
PROJECT_ROOT = Path(happypose.__file__).parent.parent
PROJECT_DIR = PROJECT_ROOT
DATA_DIR = PROJECT_DIR / "data"
# user should set "HAPPYPOSE_DATA_DIR" env or create project dir "local_data"
LOCAL_DATA_DIR = Path(
os.environ.get("HAPPYPOSE_DATA_DIR", Path(PROJECT_DIR) / "local_data"),
)
assert LOCAL_DATA_DIR.exists(), "Did you forget to set env variable 'HAPPYPOSE_DATA_DIR'?"
TEST_DATA_DIR = LOCAL_DATA_DIR
DASK_LOGS_DIR = LOCAL_DATA_DIR / "dasklogs"
SYNT_DS_DIR = LOCAL_DATA_DIR / "synt_datasets"
Expand All @@ -36,7 +38,6 @@
DEPS_DIR = PROJECT_DIR / "deps"
CACHE_DIR = LOCAL_DATA_DIR / "joblib_cache"

assert LOCAL_DATA_DIR.exists()
CACHE_DIR.mkdir(exist_ok=True)
TEST_DATA_DIR.mkdir(exist_ok=True)
DASK_LOGS_DIR.mkdir(exist_ok=True)
Expand Down
2 changes: 2 additions & 0 deletions happypose/pose_estimators/megapose/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

PROJECT_ROOT = Path(happypose.__file__).parent.parent
PROJECT_DIR = PROJECT_ROOT
# user should set "HAPPYPOSE_DATA_DIR" env or create project dir "local_data"
LOCAL_DATA_DIR = Path(
os.environ.get("HAPPYPOSE_DATA_DIR", Path(PROJECT_DIR) / "local_data"),
)
assert LOCAL_DATA_DIR.exists(), "Did you forget to set env variable 'HAPPYPOSE_DATA_DIR'?"
BOP_DS_DIR = LOCAL_DATA_DIR / "bop_datasets"
NB_DATA_DIR = LOCAL_DATA_DIR / "notebook_data"
SHAPENET_DIR = LOCAL_DATA_DIR / "shapenetcorev2"
Expand Down

0 comments on commit 66ebb7b

Please sign in to comment.