Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change hardcoded dataset path to environ variable #51

Merged
merged 2 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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