image_output_1.png
import cv2

import glob

import matplotlib.pyplot as plt

import numpy as np

import os

INPUT_PATH = '../input/cityscapes-image-pairs/cityscapes_data'

BATCH_SIZE = 4
INPUT_IMG_SIZE = 256
OUTPUT_CLASSES = 10
LEARINING_RATE = 0.001

train_files = glob.glob(os.path.join(INPUT_PATH + '/train', '*jpg'))
val_files = glob.glob(os.path.join(INPUT_PATH + '/val', '*jpg'))

fig, axes = plt.subplots(1,2, figsize = (20,5))
for i, ax in enumerate(axes.ravel()):
    img = cv2.imread(train_files[i])
    ax.imshow(img)
    #ax.axis('off')
plt.show()

for i in train_files[:2]:
    org_img = cv2.imread(i)
    img = org_img[:, 0:256, :]
    msk = org_img[:, 256:, :]

kmeans_data = []
for i in train_files[:50]:
    org_img = cv2.imread(i)
    msk = org_img[:, INPUT_IMG_SIZE:, :]
    kmeans_data.append(msk)
kmeans_data = np.array(kmeans_data)
kmeans_data = kmeans_data.reshape(-1, 3)
print(kmeans_data.shape)