timmeyer commited on
Commit
09a39d2
·
verified ·
1 Parent(s): 1de5781

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ image_path = "https://farm5.staticflickr.com/4007/4322154488_997e69e4cf_z.jpg"
3
+ pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)
4
+ pillow_mask = pipe(img_path, return_mask = True) # outputs a pillow mask
5
+ pillow_image = pipe(image_path) # applies mask on input and returns a pillow image