import numpy as np
import matplotlib.pyplot as plt
import cv2

# === Load the data ===
data = np.load('Documents/sideViewsCat.npz')  # <-- Replace with your file
print(data.files)

N = 128

a = data['output0']
b = data['output1']

# === Reshape to 64x64 ===
image0 = a.reshape((N,N))
image1 = b.reshape((N,N))

fig, axs = plt.subplots(1, 2, figsize=(10, 5))

# === Display the image ===
axs[0].imshow(image0, cmap='gray')  # Use 'gray' or remove cmap for default
axs[0].axis('off')

axs[1].imshow(image1, cmap='gray')  # Use 'gray' or remove cmap for default
axs[1].axis('off')

img_norm = image1 - np.min(image1)                  # Subtract min
img_norm = img_norm / np.max(img_norm)        # Divide by max
img_uint8 = (img_norm * 255).astype(np.uint8) # Scale and convert to uint8

# cv2.imwrite('/Users/jon/Documents/PROJECTS/15_dualPhotography/results/cat_NLS.png', img_uint8)

plt.tight_layout()
plt.show()