import os import numpy as np import matplotlib.pyplot as plt from PIL import Image import cv2 DATA_DIR = "chest_xray" TRAIN_DIR = os.path.join(DATA_DIR, "train") # Peek at a sample image sample_path = os.path.join(TRAIN_DIR, "NORMAL", os.listdir(os.path.join(TRAIN_DIR, "NORMAL"))[0]) sample_image = cv2.imread(sample_path, cv2.IMREAD_GRAYSCALE) print(f"Image shape: {sample_image.shape}") print(f"Pixel range: {sample_image.min()} to {sample_image.max()}") print(f"Data type: {sample_image.dtype}")