(img)
| 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) |
nothing calls this directly
no outgoing calls
no test coverage detected