Add compiling packnet model, refactor modules to not duplicate loaders and trainers
This commit is contained in:
4
util.py
4
util.py
@@ -5,9 +5,9 @@ import tensorflow.keras as keras
|
||||
def crop_and_resize(x, out_shape=(224, 224)):
|
||||
shape = tf.shape(x['depth'])
|
||||
img_shape = tf.shape(x['image'])
|
||||
# Ensure we get a square for when we resize is later.
|
||||
# Ensure we get a square for when we resize it later.
|
||||
# For horizontal images this is basically just cropping the sides off
|
||||
center_shape = min(shape[1], shape[2], img_shape[1], img_shape[2])
|
||||
center_shape = tf.minimum(shape[1], tf.minimum(shape[2], tf.minimum(img_shape[1], img_shape[2])))
|
||||
|
||||
def layer():
|
||||
return keras.Sequential([
|
||||
|
||||
Reference in New Issue
Block a user