From 945a27387fbc74d0ccf3efc4a0a0ea5f56eecde4 Mon Sep 17 00:00:00 2001 From: ErikValle Date: Sat, 25 Mar 2023 15:10:10 +0800 Subject: [PATCH 1/2] Replace transforms.Scale(96) in lines 95, 102 and 109 with transforms.Resize(256), add requirements.txt and bash script for tests --- README.md | 7 + drt.py | 6 +- requirements.txt | 655 +++++++++++++++++++++++++++++++++++++++++++++++ test.sh | 43 ++++ tree.txt | 19 ++ 5 files changed, 727 insertions(+), 3 deletions(-) create mode 100644 requirements.txt create mode 100644 test.sh create mode 100644 tree.txt diff --git a/README.md b/README.md index 2044eda..570f0cd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,14 @@ If you use this code in your research please consider citing Please merge the dataset and the label into the same folder ### Evaluate DRT +#### You can evaluate the model automatically by running the script below or just going to the next section +``` +chmod +x test.sh +./test.sh +``` + +#### Manual test The pre-trained models are provided- [Clipart](https://drive.google.com/file/d/1mh1jpUWQrginSACZvZDmtyYeh-TZUxBS/view?usp=sharing), [Infograph](https://drive.google.com/file/d/16zmGRRnXwsTMgj2-RKhwWdaOLXkozXMl/view?usp=sharing), [Painting](https://drive.google.com/file/d/15YhOjPjuutHrcK-m511OERu_4vIVYArD/view?usp=sharing), [Quickdraw](https://drive.google.com/file/d/1O4JwTDudqT1aj2VfFxgU1ld7bk0Hlcth/view?usp=sharing), [Real](https://drive.google.com/file/d/1ygMj4nJU74qywMbdq2DvQyyZZHngBD-3/view?usp=sharing), [Sketch](https://drive.google.com/file/d/1FVNy6OVkptKCL6rp7SqRlrZ5aYM-77vy/view?usp=sharing). Here we use 'Clipart' as an example. If you want to test other domains, all you need to do is just to replace the name of the dataset. ``` diff --git a/drt.py b/drt.py index 333402d..3cb60f3 100644 --- a/drt.py +++ b/drt.py @@ -92,21 +92,21 @@ def print_options(save_path, opt): data_transforms = { src_path: transforms.Compose([ - transforms.Scale(256), + transforms.Resize(256), transforms.RandomHorizontalFlip(), transforms.RandomCrop(224), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) ]), trg_path: transforms.Compose([ - transforms.Scale(256), + transforms.Resize(256), transforms.RandomHorizontalFlip(), transforms.RandomCrop(224), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) ]), val_path: transforms.Compose([ - transforms.Scale(256), + transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e51c8b7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,655 @@ +# This file may be used to create an environment using: +# $ conda create --name DRT --file requirements.txt +# platform: linux-64, AWS SageMaker conda_pytorch_p39 +_libgcc_mutex=0.1=conda_forge +_openmp_mutex=4.5=2_kmp_llvm +aiohttp=3.8.3=py39hb9d737c_1 +aiosignal=1.3.1=pyhd8ed1ab_0 +alabaster=0.7.12=py_0 +alsa-lib=1.2.7.2=h166bdaf_0 +aniso8601=9.0.1=pypi_0 +ansi2html=1.8.0=pypi_0 +anyio=3.6.2=pyhd8ed1ab_0 +aom=3.5.0=h27087fc_0 +appdirs=1.4.4=pyh9f0ad1d_0 +argon2-cffi=21.3.0=pyhd8ed1ab_0 +argon2-cffi-bindings=21.2.0=py39hb9d737c_3 +arrow=1.2.3=pyhd8ed1ab_0 +astroid=2.11.6=py39hf3d152e_0 +astropy=5.2=py39h389d5f1_0 +asttokens=2.2.1=pyhd8ed1ab_0 +async-timeout=4.0.2=pyhd8ed1ab_0 +atomicwrites=1.4.1=pyhd8ed1ab_0 +attr=2.5.1=h166bdaf_1 +attrs=22.2.0=pyh71513ae_0 +autopep8=1.6.0=pyhd8ed1ab_1 +autovizwidget=0.20.3=pyh1a96a4e_0 +awscli=1.27.71=pypi_0 +babel=2.11.0=pyhd8ed1ab_0 +backcall=0.2.0=pyh9f0ad1d_0 +backports=1.0=pyhd8ed1ab_3 +backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0 +bcrypt=4.0.1=pypi_0 +beautifulsoup4=4.11.1=pyha770c72_0 +binaryornot=0.4.4=py_1 +bitarray=2.6.1=py39h72bdee0_0 +black=22.10.0=py39hf3d152e_2 +blas=2.116=mkl +blas-devel=3.9.0=16_linux64_mkl +bleach=5.0.1=pyhd8ed1ab_0 +blosc=1.21.3=hafa529b_0 +bokeh=2.4.3=pyhd8ed1ab_3 +boto3=1.26.71=pypi_0 +botocore=1.29.71=pypi_0 +bottleneck=1.3.5=py39h2ae25f5_1 +brotli=1.0.9=h166bdaf_8 +brotli-bin=1.0.9=h166bdaf_8 +brotlipy=0.7.0=py39hb9d737c_1005 +brunsli=0.1=h9c3ff4c_0 +bzip2=1.0.8=h7f98852_4 +c-ares=1.18.1=h7f98852_0 +c-blosc2=2.6.1=hf91038e_0 +ca-certificates=2022.12.7=ha878542_0 +cached-property=1.5.2=hd8ed1ab_1 +cached_property=1.5.2=pyha770c72_1 +cairo=1.16.0=ha61ee94_1014 +captum=0.5.0=0 +catalogue=2.0.8=py39hf3d152e_1 +certifi=2022.12.7=pyhd8ed1ab_0 +cffi=1.15.1=py39he91dace_3 +cfitsio=4.2.0=hd9d235c_0 +chardet=5.1.0=py39hf3d152e_0 +charls=2.3.4=h9c3ff4c_0 +charset-normalizer=2.1.1=pyhd8ed1ab_0 +click=8.1.3=unix_pyhd8ed1ab_2 +cloudpickle=2.2.0=pyhd8ed1ab_0 +cmake=3.22.3=h5432695_0 +colorama=0.4.3=py_0 +comm=0.1.2=pyhd8ed1ab_0 +confection=0.0.3=py39hcca971b_1 +contextlib2=21.6.0=pypi_0 +contourpy=1.0.6=py39hf939315_0 +cookiecutter=2.1.1=pyh6c4a22f_0 +coverage=7.0.4=py39h72bdee0_0 +cryptography=39.0.0=py39hd598818_0 +cuda=11.7.1=0 +cuda-cccl=11.7.91=0 +cuda-command-line-tools=11.7.1=0 +cuda-compiler=11.7.1=0 +cuda-cudart=11.7.99=0 +cuda-cudart-dev=11.7.99=0 +cuda-cuobjdump=11.7.91=0 +cuda-cupti=11.7.101=0 +cuda-cuxxfilt=11.7.91=0 +cuda-demo-suite=12.0.76=0 +cuda-documentation=12.0.76=0 +cuda-driver-dev=11.7.99=0 +cuda-gdb=12.0.90=0 +cuda-libraries=11.7.1=0 +cuda-libraries-dev=11.7.1=0 +cuda-memcheck=11.8.86=0 +cuda-nsight=12.0.78=0 +cuda-nsight-compute=12.0.0=0 +cuda-nvcc=11.7.99=0 +cuda-nvdisasm=12.0.76=0 +cuda-nvml-dev=11.7.91=0 +cuda-nvprof=12.0.90=0 +cuda-nvprune=11.7.91=0 +cuda-nvrtc=11.7.99=0 +cuda-nvrtc-dev=11.7.99=0 +cuda-nvtx=11.7.91=0 +cuda-nvvp=12.0.90=0 +cuda-runtime=11.7.1=0 +cuda-sanitizer-api=12.0.90=0 +cuda-toolkit=11.7.1=0 +cuda-tools=11.7.1=0 +cuda-visual-tools=11.7.1=0 +cudatoolkit=11.7.0=hd8887f6_11 +curl=7.86.0=h7bff187_1 +cycler=0.11.0=pyhd8ed1ab_0 +cymem=2.0.7=py39h5a03fae_1 +cython=0.29.33=py39h227be39_0 +cython-blis=0.7.9=py39h2ae25f5_1 +cytoolz=0.12.0=py39hb9d737c_1 +dask=2022.11.0=pyhd8ed1ab_0 +dask-core=2022.11.0=pyhd8ed1ab_0 +dataclasses=0.8=pyhc8e2a94_3 +dav1d=1.0.0=h166bdaf_1 +dbus=1.13.6=h5008d03_3 +debugpy=1.6.5=py39h227be39_0 +decorator=5.1.1=pyhd8ed1ab_0 +defusedxml=0.7.1=pyhd8ed1ab_0 +diff-match-patch=20200713=pyh9f0ad1d_0 +dill=0.3.6=pyhd8ed1ab_1 +distributed=2022.11.0=pyhd8ed1ab_0 +distro=1.8.0=pypi_0 +docker=6.0.1=pypi_0 +docker-compose=1.29.2=pypi_0 +dockerpty=0.4.1=pypi_0 +docopt=0.6.2=pypi_0 +docstring-to-markdown=0.11=pyhd8ed1ab_0 +docutils=0.15.2=py39hf3d152e_6 +dparse=0.6.2=pypi_0 +dpcpp-cpp-rt=2023.0.0=hcb278e6_25371 +dpcpp_cpp_rt=2023.0.0=intel_25370 +entrypoints=0.4=pyhd8ed1ab_0 +environment-kernels=1.2.0=pypi_0 +et_xmlfile=1.0.1=py_1001 +exceptiongroup=1.1.0=pyhd8ed1ab_0 +executing=1.2.0=pyhd8ed1ab_0 +expat=2.5.0=h27087fc_0 +fastai=2.1.10=py_0 +fastcache=1.1.0=py39hb9d737c_5 +fastcore=1.5.26=pyhd8ed1ab_0 +fastprogress=1.0.3=pyhd8ed1ab_0 +ffmpeg=4.3=hf484d3e_0 +fftw=3.3.10=nompi_hf0379b8_106 +filelock=3.6.0=pypi_0 +flake8=6.0.0=pyhd8ed1ab_0 +flask=2.2.2=pyhd8ed1ab_0 +flask-cors=3.0.10=pyhd8ed1ab_0 +flask-restful=0.3.9=pypi_0 +flit-core=3.8.0=pyhd8ed1ab_0 +font-ttf-dejavu-sans-mono=2.37=hab24e00_0 +font-ttf-inconsolata=3.000=h77eed37_0 +font-ttf-source-code-pro=2.038=h77eed37_0 +font-ttf-ubuntu=0.83=hab24e00_0 +fontconfig=2.14.1=hc2a2eb6_0 +fonts-conda-ecosystem=1=0 +fonts-conda-forge=1=0 +fonttools=4.38.0=py39hb9d737c_1 +fqdn=1.5.1=pypi_0 +freetype=2.12.1=hca18f0e_1 +fribidi=1.0.10=h36c2ea0_0 +frozenlist=1.3.3=py39hb9d737c_0 +fsspec=2022.11.0=pyhd8ed1ab_0 +future=0.18.2=pyhd8ed1ab_6 +gdown=4.7.1=pypi_0 +gds-tools=1.5.0.59=0 +gettext=0.21.1=h27087fc_0 +gevent=22.10.2=py39hcf94c44_0 +giflib=5.2.1=h36c2ea0_2 +glib=2.74.1=h6239696_1 +glib-tools=2.74.1=h6239696_1 +gmp=6.2.1=h58526e2_0 +gmpy2=2.1.2=py39h376b7d2_1 +gnutls=3.6.13=h85f3911_1 +google-pasta=0.2.0=pypi_0 +graphite2=1.3.13=h58526e2_1001 +greenlet=2.0.1=py39h5a03fae_0 +gst-plugins-base=1.20.3=h57caac4_2 +gstreamer=1.20.3=hd4edc92_2 +gstreamer-orc=0.4.33=h166bdaf_0 +gym=0.26.2=pypi_0 +gym-notices=0.0.8=pypi_0 +h5py=3.7.0=nompi_py39h817c9c5_102 +harfbuzz=5.3.0=h418a68e_0 +hdf5=1.12.2=nompi_h2386368_100 +hdijupyterutils=0.20.3=pyh1a96a4e_0 +heapdict=1.0.1=py_0 +horovod=0.26.1=pypi_0 +icu=70.1=h27087fc_0 +idna=3.4=pyhd8ed1ab_0 +imagecodecs=2022.12.24=py39h9bcf58b_0 +imageio=2.16.2=pyhcf75d05_0 +imagesize=1.4.1=pyhd8ed1ab_0 +immutables=0.19=py39hb9d737c_1 +importlib-metadata=4.13.0=pypi_0 +importlib_metadata=6.0.0=hd8ed1ab_0 +importlib_resources=5.10.2=pyhd8ed1ab_0 +inflection=0.5.1=pyh9f0ad1d_0 +iniconfig=2.0.0=pyhd8ed1ab_0 +intel-cmplr-lib-rt=2023.0.0=h3eb15da_25371 +intel-cmplr-lic-rt=2023.0.0=ha770c72_25371 +intel-opencl-rt=2023.0.0=h68971e6_25371 +intel-openmp=2023.0.0=intel_25370 +intelpython=2023.0.0=1 +intervaltree=3.0.2=py_0 +ipykernel=6.20.1=pyh210e3f2_0 +ipython=7.32.0=py39hf3d152e_0 +ipython_genutils=0.2.0=py_1 +ipywidgets=8.0.4=pypi_0 +isoduration=20.11.0=pypi_0 +isort=5.11.4=pyhd8ed1ab_0 +itsdangerous=2.1.2=pyhd8ed1ab_0 +jack=1.9.21=h2a1e645_0 +jaraco.classes=3.2.3=pyhd8ed1ab_0 +jedi=0.18.2=pyhd8ed1ab_0 +jeepney=0.8.0=pyhd8ed1ab_0 +jellyfish=0.9.0=py39hb9d737c_2 +jinja2=3.1.2=pyhd8ed1ab_1 +jinja2-time=0.2.0=pyhd8ed1ab_3 +jmespath=1.0.1=pyhd8ed1ab_0 +joblib=1.2.0=pyhd8ed1ab_0 +jpeg=9e=h166bdaf_2 +json5=0.9.5=pyh9f0ad1d_0 +jsonpointer=2.3=pypi_0 +jsonschema=3.2.0=pypi_0 +jupyter=1.0.0=py39hf3d152e_8 +jupyter-client=7.4.8=pypi_0 +jupyter-events=0.6.0=pypi_0 +jupyter-server=2.0.6=pypi_0 +jupyter-server-terminals=0.4.4=pypi_0 +jupyter_console=6.4.4=pyhd8ed1ab_0 +jupyter_core=5.1.3=py39hf3d152e_0 +jupyterlab=3.3.4=pyhd8ed1ab_0 +jupyterlab-widgets=3.0.5=pypi_0 +jupyterlab_pygments=0.2.2=pyhd8ed1ab_0 +jupyterlab_server=2.18.0=pyhd8ed1ab_0 +jxrlib=1.1=h7f98852_2 +keyring=23.13.1=py39hf3d152e_0 +keyutils=1.6.1=h166bdaf_0 +kiwisolver=1.4.4=py39hf939315_1 +krb5=1.19.3=h3790be6_0 +lame=3.100=h166bdaf_1003 +langcodes=3.3.0=pyhd8ed1ab_0 +lazy-object-proxy=1.9.0=py39h72bdee0_0 +lcms2=2.14=hfd0df8a_1 +ld_impl_linux-64=2.39=hcc3a1bd_1 +lerc=4.0.0=h27087fc_0 +libaec=1.0.6=h9c3ff4c_0 +libarchive=3.6.2=hc8874e4_0 +libavif=0.11.1=h5cdd6b5_0 +libblas=3.9.0=16_linux64_mkl +libbrotlicommon=1.0.9=h166bdaf_8 +libbrotlidec=1.0.9=h166bdaf_8 +libbrotlienc=1.0.9=h166bdaf_8 +libcap=2.66=ha37c62d_0 +libcblas=3.9.0=16_linux64_mkl +libclang=14.0.6=default_h2e3cab8_0 +libclang13=14.0.6=default_h3a83d3e_0 +libcublas=11.10.3.66=0 +libcublas-dev=11.10.3.66=0 +libcufft=10.7.2.124=h4fbf590_0 +libcufft-dev=10.7.2.124=h98a8f43_0 +libcufile=1.5.0.59=0 +libcufile-dev=1.5.0.59=0 +libcups=2.3.3=h3e49a29_2 +libcurand=10.3.1.50=0 +libcurand-dev=10.3.1.50=0 +libcurl=7.86.0=h7bff187_1 +libcusolver=11.4.0.1=0 +libcusolver-dev=11.4.0.1=0 +libcusparse=11.7.4.91=0 +libcusparse-dev=11.7.4.91=0 +libdb=6.2.32=h9c3ff4c_0 +libdeflate=1.14=h166bdaf_0 +libedit=3.1.20191231=he28a2e2_2 +libev=4.33=h516909a_1 +libevent=2.1.10=h9b69904_4 +libffi=3.4.2=h7f98852_5 +libflac=1.4.2=h27087fc_0 +libgcc-ng=12.2.0=h65d4601_19 +libgcrypt=1.10.1=h166bdaf_0 +libgfortran-ng=12.2.0=h69a702a_19 +libgfortran5=12.2.0=h337968e_19 +libglib=2.74.1=h606061b_1 +libgomp=12.2.0=h65d4601_19 +libgpg-error=1.46=h620e276_0 +libhwloc=2.8.0=h32351e8_1 +libiconv=1.17=h166bdaf_0 +libjpeg-turbo=2.1.4=h166bdaf_0 +liblapack=3.9.0=16_linux64_mkl +liblapacke=3.9.0=16_linux64_mkl +liblief=0.12.3=h27087fc_0 +libllvm11=11.1.0=he0ac6c6_5 +libllvm14=14.0.6=he0ac6c6_1 +libllvm15=15.0.6=h63197d8_0 +libllvm9=9.0.1=default_hc23dcda_7 +libnghttp2=1.51.0=hdcd2b5c_0 +libnpp=11.7.4.75=0 +libnpp-dev=11.7.4.75=0 +libnsl=2.0.0=h7f98852_0 +libnvjpeg=11.8.0.2=0 +libnvjpeg-dev=11.8.0.2=0 +libogg=1.3.4=h7f98852_1 +libopenblas=0.3.21=pthreads_h78a6416_3 +libopus=1.3.1=h7f98852_1 +libpng=1.6.39=h753d276_0 +libpq=14.5=h72a31a5_3 +libprotobuf=3.20.2=h6239696_0 +libsndfile=1.1.0=hcb278e6_1 +libsodium=1.0.18=h36c2ea0_1 +libspatialindex=1.9.3=h9c3ff4c_4 +libsqlite=3.40.0=h753d276_0 +libssh2=1.10.0=haa6b8db_3 +libstdcxx-ng=12.2.0=h46fd767_19 +libsystemd0=252=h2a991cd_0 +libtiff=4.5.0=h82bc61c_0 +libtool=2.4.7=h27087fc_0 +libudev1=252=h166bdaf_0 +libuuid=2.32.1=h7f98852_1000 +libuv=1.44.2=h166bdaf_0 +libvorbis=1.3.7=h9c3ff4c_0 +libwebp=1.2.4=h1daa5a0_1 +libwebp-base=1.2.4=h166bdaf_0 +libxcb=1.13=h7f98852_1004 +libxkbcommon=1.0.3=he3ba5ed_0 +libxml2=2.10.3=h7463322_0 +libxslt=1.1.37=h873f0b0_0 +libzlib=1.2.13=h166bdaf_4 +libzopfli=1.0.3=h9c3ff4c_0 +llvm-openmp=15.0.6=he0ac6c6_0 +llvmlite=0.39.1=py39h7d9a04d_1 +locket=1.0.0=pyhd8ed1ab_0 +lz4=4.2.0=py39h724f13c_0 +lz4-c=1.9.3=h9c3ff4c_1 +lzo=2.10=h516909a_1000 +magma-cuda117=2.6.1=1 +markupsafe=2.1.1=py39hb9d737c_2 +matplotlib=3.5.3=py39hf3d152e_2 +matplotlib-base=3.5.3=py39h19d6b11_2 +matplotlib-inline=0.1.6=pyhd8ed1ab_0 +mccabe=0.7.0=pyhd8ed1ab_0 +mistune=2.0.4=pyhd8ed1ab_0 +mkl=2022.1.0=h84fe81f_915 +mkl-devel=2022.1.0=ha770c72_916 +mkl-include=2022.1.0=h84fe81f_915 +mkl-service=2.4.0=py39hb699420_0 +mkl_fft=1.3.1=py39h051f8f4_4 +mkl_random=1.2.2=py39h8b66066_1 +mkl_umath=0.1.1=py39h0348192_26 +mock=5.0.1=pyhd8ed1ab_0 +more-itertools=9.0.0=pyhd8ed1ab_0 +mpc=1.2.1=h9f54685_0 +mpfr=4.1.0=h9202a9a_1 +mpg123=1.31.1=h27087fc_0 +mpi4py=3.1.4=pypi_0 +mpmath=1.2.1=pyhd8ed1ab_0 +msgpack-python=1.0.4=py39hf939315_1 +multidict=6.0.4=py39h72bdee0_0 +multiprocess=0.70.14=pypi_0 +munkres=1.1.4=pyh9f0ad1d_0 +murmurhash=1.0.9=py39h5a03fae_1 +mypy_extensions=0.4.3=py39hf3d152e_6 +mysql-common=8.0.31=haf5c9bc_0 +mysql-libs=8.0.31=h28c427c_0 +nbclassic=0.4.8=pyhd8ed1ab_0 +nbclient=0.7.2=pyhd8ed1ab_0 +nbconvert=7.2.7=pyhd8ed1ab_0 +nbconvert-core=7.2.7=pyhd8ed1ab_0 +nbconvert-pandoc=7.2.7=pyhd8ed1ab_0 +nbformat=5.7.1=pyhd8ed1ab_0 +ncurses=6.3=h27087fc_1 +nest-asyncio=1.5.5=pypi_0 +nettle=3.6=he412f7d_0 +networkx=3.0=pyhd8ed1ab_0 +nltk=3.8.1=pyhd8ed1ab_0 +nose=1.3.7=py_1006 +notebook=6.4.12=pyha770c72_0 +notebook-shim=0.2.2=pyhd8ed1ab_0 +nsight-compute=2022.4.0.15=0 +nspr=4.35=h27087fc_0 +nss=3.82=he02c5a1_0 +numba=0.56.4=py39h61ddf18_0 +numexpr=2.7.3=py39hde0f152_1 +numpy=1.23.5=pypi_0 +numpydoc=1.5.0=pyhd8ed1ab_0 +nvgpu=0.9.0=pypi_0 +nvidia-ml-py=11.515.75=pypi_0 +ocl-icd=2.3.1=h7f98852_0 +onnx=1.11.0=py39hfc621d9_2 +openblas=0.3.21=pthreads_h320a7e8_3 +opencv-python=4.6.0.66=pypi_0 +openh264=2.1.1=h780b84a_0 +openjdk=11.0.15=hea3dc9f_3 +openjpeg=2.5.0=hfec8fc6_2 +openpyxl=3.0.10=py39hb9d737c_2 +openssl=1.1.1s=h0b41bf4_1 +packaging=21.3=pypi_0 +pandas=1.4.4=py39h1832856_0 +pandoc=2.19.2=h32600fe_1 +pandocfilters=1.5.0=pyhd8ed1ab_0 +pango=1.50.12=h382ae3d_0 +paramiko=3.0.0=pypi_0 +parso=0.8.3=pyhd8ed1ab_0 +partd=1.3.0=pyhd8ed1ab_0 +path=16.6.0=py39hf3d152e_0 +pathlib2=2.3.7.post1=py39hf3d152e_2 +pathos=0.3.0=pypi_0 +pathspec=0.10.3=pyhd8ed1ab_0 +pathy=0.10.1=pyhd8ed1ab_0 +patsy=0.5.3=pyhd8ed1ab_0 +pcre=8.45=h9c3ff4c_0 +pcre2=10.40=hc3806b6_0 +pexpect=4.8.0=pyh1a96a4e_2 +pickleshare=0.7.5=py_1003 +pillow=9.2.0=py39h2320bf1_4 +pip=22.3.1=pyhd8ed1ab_0 +pixman=0.40.0=h36c2ea0_0 +pkginfo=1.9.6=pyhd8ed1ab_0 +pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0 +platformdirs=2.6.2=pyhd8ed1ab_0 +plotly=5.11.0=pyhd8ed1ab_1 +pluggy=1.0.0=pyhd8ed1ab_5 +ply=3.11=py_1 +pooch=1.6.0=pyhd8ed1ab_0 +pox=0.3.2=pypi_0 +ppft=1.7.6.6=pypi_0 +preshed=3.0.8=py39h5a03fae_1 +prometheus_client=0.15.0=pyhd8ed1ab_0 +prompt-toolkit=3.0.36=pyha770c72_0 +prompt_toolkit=3.0.36=hd8ed1ab_0 +protobuf=3.20.2=py39h5a03fae_1 +protobuf3-to-dict=0.1.5=pypi_0 +psutil=5.9.4=py39hb9d737c_0 +psycopg2=2.9.3=py39hb9d737c_1 +psycopg2-binary=2.9.3=pyhd8ed1ab_2 +pthread-stubs=0.4=h36c2ea0_1001 +ptyprocess=0.7.0=pyhd3deb0d_0 +pulseaudio=14.0=habe0971_10 +pure_eval=0.2.2=pyhd8ed1ab_0 +py-lief=0.12.3=py39h5a03fae_0 +py4j=0.10.9.5=pypi_0 +pyarrow=10.0.1=pypi_0 +pyasn1=0.4.8=py_0 +pybind11=2.9.2=py39hf939315_1 +pybind11-global=2.9.2=py39hf939315_1 +pycodestyle=2.10.0=pyhd8ed1ab_0 +pycosat=0.6.4=py39hb9d737c_1 +pycparser=2.21=pyhd8ed1ab_0 +pycryptodome=3.16.0=py39h709f0c5_0 +pycurl=7.45.1=py39hd73adbb_3 +pydantic=1.10.4=py39h72bdee0_1 +pydocstyle=6.2.2=pyhd8ed1ab_0 +pyerfa=2.0.0.1=py39h2ae25f5_3 +pyflakes=3.0.1=pyhd8ed1ab_0 +pyfunctional=1.4.3=pypi_0 +pygame=2.1.2=pypi_0 +pygments=2.14.0=pyhd8ed1ab_0 +pykerberos=1.2.4=py39ha6ecad8_2 +pylint=2.14.4=pyhd8ed1ab_0 +pylint-venv=2.3.0=pyhd8ed1ab_0 +pyls-spyder=0.4.0=pyhd8ed1ab_0 +pynacl=1.5.0=pypi_0 +pynvml=11.4.1=pyhd8ed1ab_0 +pyodbc=4.0.35=py39h5a03fae_0 +pyopenssl=23.0.0=pyhd8ed1ab_0 +pyparsing=3.0.9=pyhd8ed1ab_0 +pyqt=5.15.7=py39h18e9c17_2 +pyqt5-sip=12.11.0=py39h5a03fae_2 +pyqtwebengine=5.15.7=py39h18e9c17_2 +pyrsistent=0.19.3=py39h72bdee0_0 +pysocks=1.7.1=pyha2e5f31_6 +pyspark=3.3.0=pypi_0 +pytables=3.7.0=py39h6a7961f_3 +pytest=7.2.0=pyhd8ed1ab_2 +python=3.9.15=h47a2c10_0_cpython +python-dateutil=2.8.2=pyhd8ed1ab_0 +python-dotenv=0.21.1=pypi_0 +python-fastjsonschema=2.16.2=pyhd8ed1ab_0 +python-json-logger=2.0.4=pypi_0 +python-lsp-black=1.2.1=pyhd8ed1ab_0 +python-lsp-jsonrpc=1.0.0=pyhd8ed1ab_0 +python-lsp-server=1.7.0=hd8ed1ab_0 +python-lsp-server-base=1.7.0=pyhd8ed1ab_0 +python-slugify=7.0.0=pyhd8ed1ab_0 +python_abi=3.9=3_cp39 +pytoolconfig=1.2.4=pyhd8ed1ab_1 +pytorch=1.13.1=py3.9_cuda11.7_cudnn8.5.0_0 +pytorch-cuda=11.7=h67b0de4_1 +pytorch-mutex=1.0=cuda +pytz=2022.7=pyhd8ed1ab_0 +pywavelets=1.4.1=py39h389d5f1_0 +pyxdg=0.28=pyhd8ed1ab_0 +pyyaml=5.4.1=pypi_0 +pyzmq=24.0.1=py39headdf64_1 +qdarkstyle=3.0.3=pyhd8ed1ab_0 +qstylizer=0.2.2=pyhd8ed1ab_0 +qt-main=5.15.6=hc525480_0 +qt-webengine=5.15.4=hcbadb6c_3 +qtawesome=1.2.2=pyhd8ed1ab_0 +qtconsole=5.4.0=pyhd8ed1ab_0 +qtconsole-base=5.4.0=pyha770c72_0 +qtpy=2.3.0=pyhd8ed1ab_0 +readline=8.1.2=h0f457ee_0 +regex=2022.10.31=py39hb9d737c_0 +requests=2.28.1=pyhd8ed1ab_1 +requests-kerberos=0.12.0=py39hf3d152e_4 +rfc3339-validator=0.1.4=pypi_0 +rfc3986-validator=0.1.1=pypi_0 +rhash=1.4.3=h166bdaf_0 +ripgrep=13.0.0=h2f28480_2 +rope=1.6.0=pyhd8ed1ab_0 +rsa=4.7.2=pyh44b312d_0 +rtree=1.0.1=py39hb102c33_1 +ruamel-yaml=0.17.21=pypi_0 +ruamel-yaml-clib=0.2.7=pypi_0 +ruamel_yaml=0.15.80=py39hb9d737c_1008 +s3fs=0.4.2=pypi_0 +s3transfer=0.6.0=pypi_0 +sagemaker=2.132.0=pypi_0 +sagemaker-pyspark=1.4.5=pypi_0 +schema=0.7.5=pypi_0 +scikit-image=0.19.3=py39h4661b88_2 +scikit-learn=1.0=pypi_0 +scipy=1.8.1=py39hddc5342_3 +seaborn=0.11.2=hd8ed1ab_0 +seaborn-base=0.11.2=pyhd8ed1ab_0 +secretstorage=3.3.3=py39hf3d152e_1 +send2trash=1.8.0=pyhd8ed1ab_0 +setuptools=65.6.3=pyhd8ed1ab_0 +shap=0.40.0=pypi_0 +shellingham=1.5.0.post1=pyhd8ed1ab_0 +sip=6.7.5=py39h5a03fae_0 +six=1.16.0=pyh6c4a22f_0 +slicer=0.0.7=pyhd8ed1ab_0 +smart_open=5.2.1=pyhd8ed1ab_0 +smclarify=0.3=pypi_0 +smdebug-rulesconfig=1.0.1=pypi_0 +snappy=1.1.9=hbd366e4_2 +sniffio=1.3.0=pyhd8ed1ab_0 +snowballstemmer=2.2.0=pyhd8ed1ab_0 +sortedcontainers=2.4.0=pyhd8ed1ab_0 +soupsieve=2.3.2.post1=pyhd8ed1ab_0 +spacy=3.4.4=py39h0354152_0 +spacy-legacy=3.0.11=pyhd8ed1ab_0 +spacy-loggers=1.0.4=pyhd8ed1ab_0 +sparkmagic=0.20.3=pyhd8ed1ab_0 +sphinx=5.1.1=pyhd8ed1ab_1 +sphinxcontrib-applehelp=1.0.2=py_0 +sphinxcontrib-devhelp=1.0.2=py_0 +sphinxcontrib-htmlhelp=2.0.0=pyhd8ed1ab_0 +sphinxcontrib-jsmath=1.0.1=py_0 +sphinxcontrib-qthelp=1.0.3=py_0 +sphinxcontrib-serializinghtml=1.1.5=pyhd8ed1ab_2 +sphinxcontrib-websupport=1.2.4=pyhd8ed1ab_1 +spyder=5.4.1=py39hf3d152e_1 +spyder-kernels=2.4.1=unix_pyhd8ed1ab_0 +sqlalchemy=1.4.46=py39h72bdee0_0 +sqlite=3.40.0=h4ff8645_0 +srsly=2.4.5=py39h5a03fae_1 +stack_data=0.6.2=pyhd8ed1ab_0 +statsmodels=0.13.5=py39h2ae25f5_2 +sympy=1.11.1=py39hf3d152e_2 +tabulate=0.9.0=pypi_0 +tbb=2021.7.0=h924138e_1 +tbb4py=2021.7.0=py39hfd2a590_1 +tblib=1.7.0=pyhd8ed1ab_0 +tenacity=8.1.0=pyhd8ed1ab_0 +termcolor=2.2.0=pypi_0 +terminado=0.17.1=pyh41d4057_0 +testpath=0.6.0=pyhd8ed1ab_0 +text-unidecode=1.3=py_0 +textdistance=4.5.0=pyhd8ed1ab_0 +texttable=1.6.7=pypi_0 +thinc=8.1.6=py39h0354152_1 +threadpoolctl=3.1.0=pyh8a188c0_0 +three-merge=0.1.1=pyh9f0ad1d_0 +tifffile=2022.10.10=pyhd8ed1ab_0 +tinycss2=1.2.1=pyhd8ed1ab_0 +tk=8.6.12=h27826a3_0 +toml=0.10.2=pyhd8ed1ab_0 +tomli=2.0.1=pyhd8ed1ab_0 +tomlkit=0.11.6=pyha770c72_0 +toolz=0.12.0=pyhd8ed1ab_0 +torch-model-archiver=0.6.1=py39_0 +torch-workflow-archiver=0.2.6=py39_0 +torchaudio=0.13.1=py39_cu117 +torchserve=0.6.1=py39_0 +torchtext=0.14.1=py39 +torchvision=0.14.1=py39_cu117 +tornado=6.2=pypi_0 +tqdm=4.63.2=pypi_0 +traitlets=5.8.1=pyhd8ed1ab_0 +typed-ast=1.5.4=py39hb9d737c_1 +typer=0.4.2=pyhd8ed1ab_0 +typing=3.10.0.0=pyhd8ed1ab_0 +typing-extensions=4.4.0=hd8ed1ab_0 +typing_extensions=4.4.0=pyha770c72_0 +tzdata=2022g=h191b570_0 +ujson=5.7.0=pypi_0 +unicodedata2=15.0.0=py39hb9d737c_0 +unidecode=1.3.6=pyhd8ed1ab_0 +unixodbc=2.3.10=h583eb01_0 +uri-template=1.2.0=pypi_0 +urllib3=1.26.8=pypi_0 +wasabi=0.10.1=pyhd8ed1ab_1 +watchdog=2.2.1=py39hf3d152e_0 +wcwidth=0.2.5=pyh9f0ad1d_2 +webcolors=1.12=pypi_0 +webencodings=0.5.1=py_1 +websocket-client=0.59.0=pypi_0 +werkzeug=2.2.2=pyhd8ed1ab_0 +whatthepatch=1.0.3=pyhd8ed1ab_0 +wheel=0.38.4=pyhd8ed1ab_0 +widgetsnbextension=4.0.5=pypi_0 +wrapt=1.14.1=py39hb9d737c_1 +wurlitzer=3.0.3=pyhd8ed1ab_0 +xcb-util=0.4.0=h166bdaf_0 +xcb-util-image=0.4.0=h166bdaf_0 +xcb-util-keysyms=0.4.0=h166bdaf_0 +xcb-util-renderutil=0.3.9=h166bdaf_0 +xcb-util-wm=0.4.1=h166bdaf_0 +xlsxwriter=3.0.6=pyhd8ed1ab_0 +xorg-fixesproto=5.0=h7f98852_1002 +xorg-inputproto=2.3.2=h7f98852_1002 +xorg-kbproto=1.0.7=h7f98852_1002 +xorg-libice=1.0.10=h7f98852_0 +xorg-libsm=1.2.3=hd9c2040_1000 +xorg-libx11=1.7.2=h7f98852_0 +xorg-libxau=1.0.9=h7f98852_0 +xorg-libxdmcp=1.1.3=h7f98852_0 +xorg-libxext=1.3.4=h7f98852_1 +xorg-libxfixes=5.0.3=h7f98852_1004 +xorg-libxi=1.7.10=h7f98852_0 +xorg-libxrender=0.9.10=h7f98852_1003 +xorg-libxtst=1.2.3=h7f98852_1002 +xorg-recordproto=1.14.2=h7f98852_1002 +xorg-renderproto=0.11.1=h7f98852_1002 +xorg-xextproto=7.3.0=h7f98852_1002 +xorg-xproto=7.0.31=h7f98852_1007 +xyzservices=2022.9.0=pyhd8ed1ab_0 +xz=5.2.6=h166bdaf_0 +yaml=0.2.5=h7f98852_2 +yapf=0.32.0=pyhd8ed1ab_0 +yarl=1.8.2=py39hb9d737c_0 +zeromq=4.3.4=h9c3ff4c_1 +zfp=1.0.0=h27087fc_3 +zict=2.2.0=pyhd8ed1ab_0 +zipp=3.11.0=pyhd8ed1ab_0 +zlib=1.2.13=h166bdaf_4 +zlib-ng=2.0.6=h166bdaf_0 +zope.event=4.6=pyhd8ed1ab_0 +zope.interface=5.5.2=py39hb9d737c_0 +zstd=1.5.2=h6239696_4 diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..bd36951 --- /dev/null +++ b/test.sh @@ -0,0 +1,43 @@ +echo "Please navigate to this repository folder" +echo "Preparing environment" +pip install gdown +echo "Downloading datasets" +wget http://csr.bu.edu/ftp/visda/2019/multi-source/groundtruth/clipart.zip +wget http://csr.bu.edu/ftp/visda/2019/multi-source/infograph.zip +wget http://csr.bu.edu/ftp/visda/2019/multi-source/groundtruth/painting.zip +wget http://csr.bu.edu/ftp/visda/2019/multi-source/quickdraw.zip +wget http://csr.bu.edu/ftp/visda/2019/multi-source/real.zip +wget http://csr.bu.edu/ftp/visda/2019/multi-source/sketch.zip +unzip clipart.zip +unzip infograph.zip +unzip painting.zip +unzip quickdraw.zip +unzip real.zip +unzip sketch.zip +rm -rf *.zip +echo "Downloading labels" +gdown 1TL6_-1vEDYlRBxV6_nYawf6CvKhpb1Ik +unzip image_list.zip +echo "Downloading weights" +mkdir weights +cd weights +gdown 1mh1jpUWQrginSACZvZDmtyYeh-TZUxBS +gdown 16zmGRRnXwsTMgj2-RKhwWdaOLXkozXMl +gdown 15YhOjPjuutHrcK-m511OERu_4vIVYArD +gdown 1O4JwTDudqT1aj2VfFxgU1ld7bk0Hlcth +gdown 1ygMj4nJU74qywMbdq2DvQyyZZHngBD-3 +gdown 1FVNy6OVkptKCL6rp7SqRlrZ5aYM-77vy +cd .. +mkdir out +echo "Running tests" +ython drt.py --batch-size 12 --num-layer 2 --save out --src_path clipart_comb.txt --trg_path quickdraw_train.txt --val_path quickdraw_test.txt --weight weights/quickdraw.pth.tar --evaluate +echo "Done" +echo "See folder out/ for details" +echo "Running training experiment" +echo "Downloading pre-trained weights" +cd weights +gdown 1xNmYXhSxNNOenSd8n87NWVtiyL5JrFXC +cd .. +echo "Training..." +python drt.py --batch-size 16 --epochs 5 --gamma 0.01 --lmbd 4.0 --lr 0.001 --lr_f 0.01 --momentum 0.9 --num-layer 2 --pretrain weights/resnet_dy_pretrained.pth --save_path out --src_path clipart_comb.txt --trg_path clipart_train.txt --val_path clipart_test.txt --schedule 5 10 15 +echo "Done :)" diff --git a/tree.txt b/tree.txt new file mode 100644 index 0000000..a4748fa --- /dev/null +++ b/tree.txt @@ -0,0 +1,19 @@ +clipart/ +datasets/ +domainNet_loader.pyc +image_list/ +LICENSE +out/ +README.md +script/ +utils.pyc +domainNet_loader.py +drt.py +infograph/ +model/ +painting/ +quickdraw/ +real/ +sketch/ +utils.py/ +weights From 6777a4bd5bb87e3b71427f02191e8fa7c6745832 Mon Sep 17 00:00:00 2001 From: Erik Valle Date: Sat, 25 Mar 2023 15:15:01 +0800 Subject: [PATCH 2/2] git commit -m "Replace transforms.Scale(96) with transforms.Resize(256), add requirements.txt and bash script for tests" --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 570f0cd..7a21a23 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ If you use this code in your research please consider citing - Hardware: PC with Tesla-V100. - Software: *CUDA >= 10.0*, *Anaconda3*, *pytorch >= 1.0.0* +- The file requirements.txt was generated after running tests in AWS SageMaker using a ml.g4dn.xlarge instance with the kernel conda_pytorch_39 ### Download Dataset @@ -20,7 +21,7 @@ If you use this code in your research please consider citing Please merge the dataset and the label into the same folder ### Evaluate DRT -#### You can evaluate the model automatically by running the script below or just going to the next section +#### You can evaluate the model automatically by running the script below. ``` chmod +x test.sh