MCPcopy Index your code
hub / github.com/tensorlayer/SRGAN / _map_fn_train

Function _map_fn_train

train.py:57–63  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

55 for img in train_hr_imgs:
56 yield img
57 def _map_fn_train(img):
58 hr_patch = tf.image.random_crop(img, [384, 384, 3])
59 hr_patch = hr_patch / (255. / 2.)
60 hr_patch = hr_patch - 1.
61 hr_patch = tf.image.random_flip_left_right(hr_patch)
62 lr_patch = tf.image.resize(hr_patch, size=[96, 96])
63 return lr_patch, hr_patch
64 train_ds = tf.data.Dataset.from_generator(generator_train, output_types=(tf.float32))
65 train_ds = train_ds.map(_map_fn_train, num_parallel_calls=multiprocessing.cpu_count())
66 # train_ds = train_ds.repeat(n_epoch_init + n_epoch)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected