chest-xray-classification / src /create_dummy_image.py
rohitium's picture
Deploy Chest X-Ray App (LFS)
b412062
raw
history blame contribute delete
385 Bytes
import png
import numpy as np
# Generate a 1024x1024 random noise image to simulate an X-ray
width = 512
height = 512
img = np.random.randint(0, 65535, (height, width)).astype(np.uint16)
with open('data/test_xray.png', 'wb') as f:
writer = png.Writer(width=width, height=height, greyscale=True, bitdepth=16)
writer.write(f, img.tolist())
print("Created data/test_xray.png")