From 713247a3381deecf54c63b3373aa1191e5561c3d Mon Sep 17 00:00:00 2001 From: Samuel Howard Date: Thu, 5 Sep 2024 12:21:12 -0500 Subject: [PATCH] Add example creation script --- u2net/make_examples.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 u2net/make_examples.py diff --git a/u2net/make_examples.py b/u2net/make_examples.py new file mode 100644 index 0000000..2110b0d --- /dev/null +++ b/u2net/make_examples.py @@ -0,0 +1,17 @@ +from session import Session +from PIL import Image + + +if __name__ == '__main__': + image_path_list = [ + ("../examples/S2563713746_St25_G7.5.jpeg", "../examples/woman.png"), + ("../examples/Will-Smith-new-headshot-credit-Lorenzo-Agius.jpg", "../examples/ws.png"), + ("../examples/zuck_original.jpg", "../examples/zuck.png") + ] + + session = Session("../skin_u2net.onnx") + + for input_image, output_image in image_path_list: + image_in = Image.open(input_image) + output = session.remove(image_in) + output.save(output_image)