SimamAlphaXR / tests /test_alpha_core.py
junaid-simamdigital's picture
Add alpha tests
2be9278 verified
Raw History Blame Contribute Delete
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])