Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Created February 26, 2023 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/b9816dffa24629a3ca1ba858a1594b3d to your computer and use it in GitHub Desktop.
Save YiLi225/b9816dffa24629a3ca1ba858a1594b3d to your computer and use it in GitHub Desktop.
!pip install rembg
from google.colab import files
uploaded = files.upload()
## https://pixabay.com/photos/animal-mammal-fallow-deer-stag-984573/
from rembg import remove
from PIL import Image
input_img = 'deer.jpg'
output_img = 'deer_rmbg.png'
inp = Image.open(input_img)
output = remove(inp)
output.save(output_img)
files.download(output_img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment