├── LICENSE ├── README.md └── matting_anything_colab.ipynb /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 🐣 Please follow me for new updates https://twitter.com/camenduru
2 | 🔥 Please join our discord server https://discord.gg/k5BwmmvJJU
3 | 🥳 Please join my patreon community https://patreon.com/camenduru
4 | 5 | ## 🦒 Colab 6 | 7 | | Colab | Info 8 | | --- | --- | 9 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/Matting-Anything-colab/blob/main/matting_anything_colab.ipynb) | matting_anything_colab 10 | 11 | ## Main Repo 12 | https://github.com/SHI-Labs/Matting-Anything 13 | 14 | ## Page 15 | https://chrisjuniorli.github.io/project/Matting-Anything/ 16 | 17 | ## Paper 18 | https://arxiv.org/abs/2306.05399 19 | 20 | ## Output 21 | 22 | ![Screenshot 2023-06-10 012533](https://github.com/camenduru/Matting-Anything-colab/assets/54370274/29fe3bed-a5c0-453b-a8ba-2bc630d1cca7) 23 | -------------------------------------------------------------------------------- /matting_anything_colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github" 7 | }, 8 | "source": [ 9 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/Matting-Anything-colab/blob/main/matting_anything_colab.ipynb)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": { 16 | "id": "gnFREAlwFXLd" 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "%cd /content\n", 21 | "!git clone https://github.com/camenduru/Matting-Anything\n", 22 | "%cd /content/Matting-Anything\n", 23 | "\n", 24 | "!pip install -r requirements.txt\n", 25 | "!pip install -e segment-anything\n", 26 | "\n", 27 | "%env BUILD_WITH_CUDA=True\n", 28 | "!pip install -e GroundingDINO\n", 29 | "!pip install --upgrade diffusers[torch]\n", 30 | "\n", 31 | "!apt -y install -qq aria2\n", 32 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/Matting-Anything/resolve/main/mam_sam_vitb.pth -d /content/Matting-Anything/checkpoints -o mam_sam_vitb.pth\n", 33 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/Matting-Anything/resolve/main/groundingdino_swint_ogc.pth -d /content/Matting-Anything/checkpoints -o groundingdino_swint_ogc.pth\n", 34 | "\n", 35 | "%cd /content/Matting-Anything\n", 36 | "!python gradio_app.py --share" 37 | ] 38 | } 39 | ], 40 | "metadata": { 41 | "accelerator": "GPU", 42 | "colab": { 43 | "gpuType": "T4", 44 | "provenance": [] 45 | }, 46 | "kernelspec": { 47 | "display_name": "Python 3", 48 | "name": "python3" 49 | }, 50 | "language_info": { 51 | "name": "python" 52 | } 53 | }, 54 | "nbformat": 4, 55 | "nbformat_minor": 0 56 | } 57 | --------------------------------------------------------------------------------