Skip to content

Commit

Permalink
Change hardcoded dataset path to environ variable (#51)
Browse files Browse the repository at this point in the history
* 🛠  change hardcoded dataset path to environ variable

* Add dataset path to environment variable in workflow

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
  • Loading branch information
ashwinvaidya17 and Ashwin Vaidya committed Jan 5, 2022
1 parent b169c4d commit 2bae059
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
run: tox -e black,isort,flake8,pylint,mypy,pydocstyle
- name: Coverage
run: |
export ANOMALIB_DATASET_PATH=/media/data1/datasets/MVTec
export CUDA_VISIBLE_DEVICES=3
tox -e coverage
- name: Upload coverage result
Expand Down
3 changes: 1 addition & 2 deletions tests/helpers/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def get_dataset_path(path: Union[str, Path] = "./datasets/MVTec"):
# when running locally
path = str(path)
if not os.path.isdir(path):
# when using docker image
path = "/tmp/anomalib/datasets/MVTec"
path = os.environ["ANOMALIB_DATASET_PATH"]
return path


Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
ANOMALIB_DATASET_PATH
deps =
coverage
pytest
Expand Down

0 comments on commit 2bae059

Please sign in to comment.