Daniel Gatis před 2 roky
rodič
revize
8ce0b8f9ac

+ 2 - 3
rembg/bg.py

@@ -74,9 +74,8 @@ def alpha_matting_cutout(
 
 
 def naive_cutout(img: PILImage, mask: PILImage) -> PILImage:
-    empty = Image.new("RGBA", (img.size), 0)
-    cutout = Image.composite(img, empty, mask)
-    return cutout
+    img.putalpha(mask)
+    return img
 
 
 def get_concat_v_multi(imgs: List[PILImage]) -> PILImage:

binární
tests/results/anime-girl-1.isnet-anime.png


binární
tests/results/anime-girl-1.isnet-general-use.png


binární
tests/results/anime-girl-1.sam.png


binární
tests/results/anime-girl-1.silueta.png


binární
tests/results/anime-girl-1.u2net.png


binární
tests/results/anime-girl-1.u2net_cloth_seg.png


binární
tests/results/anime-girl-1.u2net_human_seg.png


binární
tests/results/anime-girl-1.u2netp.png


binární
tests/results/car-1.isnet-anime.png


binární
tests/results/car-1.isnet-general-use.png


binární
tests/results/car-1.sam.png


binární
tests/results/car-1.silueta.png


binární
tests/results/car-1.u2net.png


binární
tests/results/car-1.u2net_cloth_seg.png


binární
tests/results/car-1.u2net_human_seg.png


binární
tests/results/car-1.u2netp.png


binární
tests/results/cloth-1.isnet-anime.png


binární
tests/results/cloth-1.isnet-general-use.png


binární
tests/results/cloth-1.sam.png


binární
tests/results/cloth-1.silueta.png


binární
tests/results/cloth-1.u2net.png


binární
tests/results/cloth-1.u2net_cloth_seg.png


binární
tests/results/cloth-1.u2net_human_seg.png


binární
tests/results/cloth-1.u2netp.png


+ 1 - 1
tests/test_remove.py

@@ -47,7 +47,7 @@ def test_remove():
 
             expected_path = Path(here / "results" / f"{picture}.{model}.png")
             # Uncomment to update the expected results
-            # f = open(expected_path, "ab")
+            # f = open(expected_path, "wb")
             # f.write(actual)
             # f.close()