Download src/create_dummy_image.py from rohitium/chest-xray-classification: direct link, hf CLI and curl.
- Browser
- Download file 385 Bytes
-
https://huggingface.co/spaces/rohitium/chest-xray-classification/resolve/main/src/create_dummy_image.py
- Command line
-
hf download hf://spaces/rohitium/chest-xray-classification/src/create_dummy_image.py
-
curl -L -o create_dummy_image.py https://huggingface.co/spaces/rohitium/chest-xray-classification/resolve/main/src/create_dummy_image.py
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") | |