download_dataset.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. import argparse
  15. import os
  16. PARSER = argparse.ArgumentParser(description="U-Net medical")
  17. PARSER.add_argument('--data_dir',
  18. type=str,
  19. default='./data',
  20. help="""Directory where to download the dataset""")
  21. def main():
  22. FLAGS = PARSER.parse_args()
  23. if not os.path.exists(FLAGS.data_dir):
  24. os.makedirs(FLAGS.data_dir)
  25. os.system('wget http://brainiac2.mit.edu/isbi_challenge/sites/default/files/train-volume.tif -P {}'.format(FLAGS.data_dir))
  26. os.system('wget http://brainiac2.mit.edu/isbi_challenge/sites/default/files/train-labels.tif -P {}'.format(FLAGS.data_dir))
  27. os.system('wget http://brainiac2.mit.edu/isbi_challenge/sites/default/files/test-volume.tif -P {}'.format(FLAGS.data_dir))
  28. print("Finished downloading files for U-Net medical to {}".format(FLAGS.data_dir))
  29. if __name__ == '__main__':
  30. main()