Commit ·
d1eea16
1
Parent(s): c527acb
Made background transparent in generated mask
Browse filesFiles changed (2)
- .gitignore+3-1
- app.py+6-4
1__pycache__123__pycache__*.diff.DS_Store
13 unmodified lines1415161718192021222322 unmodified lines4647484913 unmodified linesdef run(image_path, threshold):image = np.asarray(Image.open(image_path).convert('RGB'))# We copy the image that and fill it with black, to get the dimensionsrgb = np.copy(image)rgb.fill(0)masks = model(image_path, threshold, 1)mask = masks[0]22 unmodified linesexamples=[[path.as_posix(), 0.15] for path in paths],title=TITLE,description=DESCRIPTION)demo.queue().launch()13 unmodified lines141516171819202122232422 unmodified lines474849505113 unmodified linesdef run(image_path, threshold):image = Image.open(image_path).convert('RGBA')canvas = Image.new('RGBA', image.size, (0, 0, 0, 0))# We copy the image that and fill it with black, to get the dimensionsrgb = np.array(canvas)masks = model(image_path, threshold, 1)mask = masks[0]22 unmodified linesexamples=[[path.as_posix(), 0.15] for path in paths],title=TITLE,description=DESCRIPTION)demo.queue(concurrency_count=3, api_open=True)demo.launch()
.gitignore+3-1
app.py+6-4