|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# -*- coding: utf-8 -*- |
| 4 | +# |
| 5 | +# Copyright (c) 2018 Intel Corporation |
| 6 | +# |
| 7 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +# you may not use this file except in compliance with the License. |
| 9 | +# You may obtain a copy of the License at |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, software |
| 14 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +# See the License for the specific language governing permissions and |
| 17 | +# limitations under the License. |
| 18 | +# |
| 19 | +# SPDX-License-Identifier: EPL-2.0 |
| 20 | +# |
| 21 | + |
| 22 | +# You'll need to download the Decathlon dataset. |
| 23 | +# You can get the data here: http://medicaldecathlon.com/ |
| 24 | +# Currently it is on Google Drive: |
| 25 | +# https://drive.google.com/drive/folders/1HqEgzS8BV2c7xYNrZdEAnrHk7osJJ--2 |
| 26 | +# Download Task01_BrainTumour.tar |
| 27 | +# Then untar to the Decathlon directory. |
| 28 | + |
| 29 | +# tar -xvf Task01_BrainTumour.tar |
| 30 | +# |
| 31 | + |
| 32 | +DECATHLON_DIR="../../data/decathlon/Task01_BrainTumour/" |
| 33 | +HDF5_DIR="../../data/decathlon/" |
| 34 | +IMG_SIZE=128 |
| 35 | +MODEL_OUTPUT_DIR="./output/" |
| 36 | + |
| 37 | +echo "Converting Decathlon raw data to HDF5 file." |
| 38 | +# Run Python script to convert to a single HDF5 file |
| 39 | +python convert_raw_to_hdf5.py --data_path $DECATHLON_DIR \ |
| 40 | + --save_path $HDF5_DIR --resize=$IMG_SIZE |
| 41 | + |
| 42 | +echo "Run U-Net training on BraTS Decathlon dataset" |
| 43 | +# Run training script |
| 44 | +# The settings.py file contains the model training. |
| 45 | +python train.py --data_path $HDF5_DIR/$IMG_SIZEx$IMG_SIZE \ |
| 46 | + --output_path $MODEL_OUTPUT_DIR |
0 commit comments