Skip to content

Commit

Permalink
Add example creation script
Browse files Browse the repository at this point in the history
  • Loading branch information
samhaswon committed Sep 5, 2024
1 parent 96f4ca8 commit 713247a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions u2net/make_examples.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 713247a

Please # to comment.