Commit 5c5e4be4 authored by Yipeng Hu's avatar Yipeng Hu

ref #7 automatic download data added

parent 25e0c1ec
import os
from tensorflow.keras.utils import get_file
import zipfile
'''
# download data
os.system('wget https://weisslab.cs.ucl.ac.uk/WEISSTeaching/datasets/-/archive/promise12/datasets-promise12.zip')
os.system('mkdir data')
os.system('unzip datasets-promise12.zip -d ./data')
os.system('rm datasets-promise12.zip')
os.system('mkdir result')
'''
DATA_PATH = './data'
RESULT_PATH = './result'
os.makedirs(DATA_PATH)
temp_file = get_file(fname='datasets-promise12.zip',
origin='https://weisslab.cs.ucl.ac.uk/WEISSTeaching/datasets/-/archive/promise12/datasets-promise12.zip')
with zipfile.ZipFile(temp_file,'r') as zip_obj:
zip_obj.extractall(DATA_PATH)
os.remove(temp_file)
os.makedirs(RESULT_PATH)
print('Promise12 data downloaded: <%s>.' % os.path.abspath(os.path.join(DATA_PATH,'datasets-promise12')))
print('Result directory created: <%s>.' % os.path.abspath(RESULT_PATH))
......@@ -5,14 +5,11 @@ import numpy as np
import random
import os
# https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/images/segmentation.ipynb
# https://becominghuman.ai/image-classification-with-tensorflow-2-0-without-keras-e6534adddab2
# https://colab.research.google.com/drive/1i-7Vn_9hGdOvMjkYNedK5nsonNizhe0o#scrollTo=z3w4D1V0SkZ8&forceEdit=true&sandboxMode=true
os.environ["CUDA_VISIBLE_DEVICES"]="0"
path_to_data = '../../../promise12' # git clone -b promise12 --single-branch https://weisslab.cs.ucl.ac.uk/WEISSTeaching/datasets.git
path_to_data = './data/datasets-promise12'
path_to_save = './result'
### Define a few functions for network layers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment