text_plain_output_1.png
import matplotlib.pyplot as plt

import pathlib

import random

import tensorflow as tf

AUTOTUNE = tf.data.experimental.AUTOTUNE

main_path = pathlib.Path('../input/oct2017/OCT2017 ')
train_path = main_path / 'train'
test_path = main_path / 'test'
val_path = main_path / 'val'
train_path

import random
train_image_paths = [str(path) for path in list(train_path.glob('*/*.jpeg'))]
random.shuffle(train_image_paths)
test_image_paths = [str(path) for path in list(test_path.glob('*/*.jpeg'))]
val_image_paths = [str(path) for path in list(val_path.glob('*/*.jpeg'))]

ex_im = tf.read_file(train_image_paths[0])
ex_im = tf.image.decode_jpeg(ex_im, channels=1)
ex_im = tf.image.resize_images(ex_im, [192, 192])
plt.imshow(ex_im[:, :, 0])