Commit a035e79b authored by Yipeng Hu's avatar Yipeng Hu

ref #1 change to local git datasets

parent 32226a3a
import os
import random
import tensorflow as tf
from matplotlib import pyplot as plt
flag_wsl = True
nSbj = 6
nFrm = 8
if flag_wsl:
home_dir = os.path.join('/mnt/c/Users/yhu') # WSL
else:
if os.name == 'nt':
home_dir = os.path.expanduser('~')
elif os.name == 'posix':
home_dir = os.environ['HOME']
filename = os.path.join(home_dir, 'Scratch/data/protocol/normalised/ultrasound_50frames.h5')
filename = '../../../datasets/ultrasound_50frames.h5'
# generate 5 random subjects
......
import tensorflow as tf
import random
import os
# import numpy as np
os.environ["CUDA_VISIBLE_DEVICES"]="0"
flag_wsl = True
if flag_wsl:
home_dir = os.path.join('/mnt/c/Users/yhu') # WSL
else:
if os.name == 'nt':
home_dir = os.path.expanduser('~')
elif os.name == 'posix':
home_dir = os.environ['HOME']
filename = os.path.join(home_dir, 'Scratch/data/protocol/normalised/ultrasound_50frames.h5')
filename = '../../../datasets/ultrasound_50frames.h5'
frame_size = tf.keras.utils.HDF5Matrix(filename, '/frame_size').data.value
frame_size = [frame_size[0][0],frame_size[1][0]]
......@@ -42,10 +29,7 @@ features = tf.keras.layers.Conv2D(128, 3, activation='relu', padding='same')(fea
features_block_4 = features + features_block_3
features = tf.keras.layers.Conv2D(128, 3, activation='relu', padding='same')(features_block_4)
features = tf.keras.layers.Conv2D(128, 3, activation='relu', padding='same')(features)
features = features + features_block_4
features = tf.keras.layers.MaxPool2D(3)(features)
features_block_5 = tf.keras.layers.Conv2D(128, 3, activation='relu')(features)
features_block_5 = features + features_block_4
features = tf.keras.layers.Conv2D(128, 3, activation='relu', padding='same')(features_block_5)
features = tf.keras.layers.Conv2D(128, 3, activation='relu', padding='same')(features)
features_block_6 = features + features_block_5
......
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