Spaces:
Sleeping
Sleeping
Download LightZero/lzero/mcts/tests/test_image_transform.py from OpenDILabCommunity/gomoku: direct link, hf CLI and curl.
- Browser
- Download file 340 Bytes
-
https://huggingface.co/spaces/OpenDILabCommunity/gomoku/resolve/main/LightZero/lzero/mcts/tests/test_image_transform.py
- Command line
-
hf download hf://spaces/OpenDILabCommunity/gomoku/LightZero/lzero/mcts/tests/test_image_transform.py
-
curl -L -o test_image_transform.py https://huggingface.co/spaces/OpenDILabCommunity/gomoku/resolve/main/LightZero/lzero/mcts/tests/test_image_transform.py
340 Bytes
| import pytest | |
| import torch | |
| from lzero.model import ImageTransforms | |
| def test_image_transform(): | |
| img = torch.rand((4, 3, 96, 96)) | |
| transform = ImageTransforms(['shift', 'intensity']) | |
| processed_img = transform.transform(img) | |
| assert img.shape == (4, 3, 96, 96) | |
| assert not (img == processed_img).all() | |