Spaces:
Sleeping
Sleeping
Download tests/test_alpha_core.py from junaid-simamdigital/SimamAlphaXR: direct link, hf CLI and curl.
- Browser
- Download file 308 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/SimamAlphaXR/resolve/main/tests/test_alpha_core.py
- Command line
-
hf download hf://spaces/junaid-simamdigital/SimamAlphaXR/tests/test_alpha_core.py
-
curl -L -o test_alpha_core.py https://huggingface.co/spaces/junaid-simamdigital/SimamAlphaXR/resolve/main/tests/test_alpha_core.py
308 Bytes
| import numpy as np | |
| from PIL import Image | |
| from alpha_core import matte_for_frame | |
| def test_green_screen_becomes_transparent(): | |
| a = matte_for_frame(Image.fromarray(np.array([[[0, 255, 0], [255, 0, 0]]], dtype=np.uint8)), "Green screen") | |
| assert a.shape == (1, 2) | |
| assert int(a[0, 0]) < int(a[0, 1]) | |