From e51984fe759596485a59aedf68ce06ea5a72bdcb Mon Sep 17 00:00:00 2001 From: Roman Shchedrin Date: Sat, 11 Apr 2020 12:20:19 +0300 Subject: [PATCH 1/3] added setup instructions, data downloader, conda environment yml --- Readme.MD | 20 +++++++++++++++++++- conda_environment.yml | 7 +++++++ download_dataset.py | 15 +++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 conda_environment.yml create mode 100644 download_dataset.py diff --git a/Readme.MD b/Readme.MD index 304360c..62f56d4 100644 --- a/Readme.MD +++ b/Readme.MD @@ -1 +1,19 @@ -Readme +Install requirements: + +``` +conda env create -f conda_environment.yml +``` +Activate conda env: +``` +conda activate domain_adaptation +``` + +Download office-31 dataset: +``` +python download_dataset.py +``` + +Run tests: +``` +python -m pytest tests +``` diff --git a/conda_environment.yml b/conda_environment.yml new file mode 100644 index 0000000..5469d68 --- /dev/null +++ b/conda_environment.yml @@ -0,0 +1,7 @@ +name: domain_adaptation +channels: + - defaults +dependencies: + - pytorch=1.4.0 + - pytest + - gdown diff --git a/download_dataset.py b/download_dataset.py new file mode 100644 index 0000000..f520c9a --- /dev/null +++ b/download_dataset.py @@ -0,0 +1,15 @@ +# if downloader doesn't work, you can download office-31 dataset from +# https://people.eecs.berkeley.edu/~jhoffman/domainadapt/ +# https://drive.google.com/file/d/0B4IapRTv9pJ1WGZVd1VDMmhwdlE/view +import gdown + +if __name__ == "__main__": + # TAKE ID FROM SHAREABLE LINK + URL = "https://drive.google.com/uc?id=0B4IapRTv9pJ1WGZVd1VDMmhwdlE" + # DESTINATION FILE ON YOUR DISK + DESTINATION = "data/domain_adaptation_images.tar.gz" + MD5_HASH = '1b536d114869a5a8aa4580b89e9758fb' + gdown.cached_download(URL, + DESTINATION, + md5=MD5_HASH, + postprocess=gdown.extractall) From 26ea95519d34196a3929fbb10c69a04b044aa590 Mon Sep 17 00:00:00 2001 From: Roman Shchedrin Date: Sat, 11 Apr 2020 13:04:43 +0300 Subject: [PATCH 2/3] changed path --- download_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download_dataset.py b/download_dataset.py index f520c9a..49fb534 100644 --- a/download_dataset.py +++ b/download_dataset.py @@ -7,7 +7,7 @@ # TAKE ID FROM SHAREABLE LINK URL = "https://drive.google.com/uc?id=0B4IapRTv9pJ1WGZVd1VDMmhwdlE" # DESTINATION FILE ON YOUR DISK - DESTINATION = "data/domain_adaptation_images.tar.gz" + DESTINATION = "data/office-31/domain_adaptation_images.tar.gz" MD5_HASH = '1b536d114869a5a8aa4580b89e9758fb' gdown.cached_download(URL, DESTINATION, From 9625a3e80203774732c3dcef19427b2e9c487af0 Mon Sep 17 00:00:00 2001 From: Roman Shchedrin Date: Sat, 11 Apr 2020 20:20:15 +0300 Subject: [PATCH 3/3] pip --- Readme.MD | 13 +++++++++---- requirements.txt | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 requirements.txt diff --git a/Readme.MD b/Readme.MD index 62f56d4..5edaeb1 100644 --- a/Readme.MD +++ b/Readme.MD @@ -1,5 +1,5 @@ -Install requirements: - +# Install requirements: +## For conda: ``` conda env create -f conda_environment.yml ``` @@ -8,12 +8,17 @@ Activate conda env: conda activate domain_adaptation ``` -Download office-31 dataset: +## For pip: +``` +pip install -r +``` + +# Download office-31 dataset: ``` python download_dataset.py ``` -Run tests: +# Run tests: ``` python -m pytest tests ``` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..99aef35 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pytorch==1.4.0 +pytest +gdown