Skip to content
Snippets Groups Projects
Commit 440caa7e authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Changed the default scaler

parent e47ee11a
No related branches found
No related tags found
1 merge request!102New baselines
...@@ -42,9 +42,10 @@ def get_preprocessor(output_shape): ...@@ -42,9 +42,10 @@ def get_preprocessor(output_shape):
layers.experimental.preprocessing.RandomFlip("horizontal"), layers.experimental.preprocessing.RandomFlip("horizontal"),
# FIXED_STANDARDIZATION from https://github.com/davidsandberg/facenet # FIXED_STANDARDIZATION from https://github.com/davidsandberg/facenet
# [-0.99609375, 0.99609375] # [-0.99609375, 0.99609375]
layers.experimental.preprocessing.Rescaling( # layers.experimental.preprocessing.Rescaling(
scale=1 / 128, offset=-127.5 / 128 # scale=1 / 128, offset=-127.5 / 128
), # ),
layers.experimental.preprocessing.Rescaling(scale=1 / 255, offset=0),
] ]
) )
return preprocessor return preprocessor
...@@ -100,7 +101,9 @@ def prepare_dataset( ...@@ -100,7 +101,9 @@ def prepare_dataset(
ignore_order = tf.data.Options() ignore_order = tf.data.Options()
ignore_order.experimental_deterministic = False ignore_order.experimental_deterministic = False
ds = ds.with_options(ignore_order) ds = ds.with_options(ignore_order)
ds = ds.map(partial(decode_tfrecords, data_shape=data_shape)).prefetch(buffer_size=autotune) ds = ds.map(partial(decode_tfrecords, data_shape=data_shape)).prefetch(
buffer_size=autotune
)
if shuffle: if shuffle:
ds = ds.shuffle(shuffle_buffer).repeat(epochs) ds = ds.shuffle(shuffle_buffer).repeat(epochs)
preprocessor = get_preprocessor(output_shape) preprocessor = get_preprocessor(output_shape)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment