BiRefNet
BiRefNet copied to clipboard
Notebooks for background removal and background replacement
Added two clean notebooks with proper instructions in the tutorials directory.
birefnet_background_removal.ipynb=> To remove background and visualize the results in a modularized way.birefnet_background_replacement.ipynb=> To replace background of an image.
Hi, @sovit-123, first, thanks for the PR. I've checked all the changes you made. The combination of that jellyfish and the purple sky is very fantastic. The modularization should be good for some greenhands to understand better.
But I have some concerns:
- The two new notebooks with the displayed images are too large (possibly heavier than all the existing files), which might not be appropriate for the GitHub repo.
- No obvious extra function is added. The background replacement is added in existing ones, such as using standard greenscreen color for video inference.
- Some codes are good, but not in my habit. For example, the display codes should be out of the inference function, or give an option for it, in my mind. And some advanced settings are not involved, such as autocast with FP16 or BF16. Loading models from HuggingFace in one line should also be useful and user-friendly to switch the BiRefNet model for different tasks.
Many thanks to your PR. I might not merge the two new files. But I'm very willing to merge your introduction into the existing inference notebook.
Hello @ZhengPeng7. Thanks for the update.