From 5e8ea671b6b456e5884be9441f2c449374d2fe64 Mon Sep 17 00:00:00 2001 From: Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:51:30 +0800 Subject: [PATCH] Update main.py --- inoutpaint/main.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/inoutpaint/main.py b/inoutpaint/main.py index 7260411..c8aa032 100644 --- a/inoutpaint/main.py +++ b/inoutpaint/main.py @@ -37,24 +37,3 @@ def run(img, w, h, t, b, l, r, mode="fill"): ) return new_img, mask, f"{w_n} x {h_n}" - - -if __name__ == "__main__": - img = Image.open( - "./01491-2023-01-21_d7ff2a1d60_KBlueLeaf_KBlueLeaf_856221927-768x512.png" - ) - new, mask, _ = run(np.array(img), 64, 192, 64, 64) - - w, h = new.size - - if w > h: - demo = Image.new("RGB", (w, h * 2)) - demo.paste(new, box=(0, 0)) - demo.paste(mask, box=(0, h)) - else: - demo = Image.new("RGB", (w * 2, h)) - demo.paste(new, box=(0, 0)) - demo.paste(mask, box=(w, 0)) - new.save("./test-img.png") - mask.save("./test-mask.png") - demo.show()