Remove Background Photo with Python

Senin, Oktober 24, 20220 komentar

1. Open your VisCode
2. Install the rembg plugin 
    --> open cmd 
    --> pip install rembg
3. Download u2net.onnx and copy the file to 
    C:\Users\User_Name\.u2net
4. Then create code like below : 

from rembg import remove
from PIL import Image
input_path = 'C:\\Users\\User_Name\\Documents\\Biodata\\Testing_input.JPG'
output_path = 'C:\\Users\\User_Name\\Documents\\Biodata\\Testing_ouput.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
Share this article :
 
Support : Awan Argoho San Storage Solution
Copyright © 2011. SHARE MY IT EXPERIENCES - All Rights Reserved
Email | awanargoho@gmail.com Whatsapp | 08111929925
Proudly powered by Blogger