{"id":16107770,"url":"https://github.com/jhj0517/sam2-playground","last_synced_at":"2025-03-17T17:31:43.315Z","repository":{"id":253940778,"uuid":"838327722","full_name":"jhj0517/sam2-playground","owner":"jhj0517","description":"Playground Web UI using segment-anything-2 models from the Meta. ","archived":false,"fork":false,"pushed_at":"2024-12-04T09:22:55.000Z","size":13372,"stargazers_count":45,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T21:09:35.414Z","etag":null,"topics":["ai","gradio","open-source","sam","sam2","segment-anything","segment-anything-2","segmentation","torch","webui"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhj0517.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"jhj0517","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-08-05T12:19:58.000Z","updated_at":"2025-02-17T00:59:29.000Z","dependencies_parsed_at":"2024-12-04T10:23:15.074Z","dependency_job_id":null,"html_url":"https://github.com/jhj0517/sam2-playground","commit_stats":null,"previous_names":["jhj0517/sam2-playground"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fsam2-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fsam2-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fsam2-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fsam2-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhj0517","download_url":"https://codeload.github.com/jhj0517/sam2-playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243875068,"owners_count":20361940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","gradio","open-source","sam","sam2","segment-anything","segment-anything-2","segmentation","torch","webui"],"created_at":"2024-10-09T19:24:25.008Z","updated_at":"2025-03-17T17:31:42.661Z","avatar_url":"https://github.com/jhj0517.png","language":"Python","funding_links":["https://ko-fi.com/jhj0517"],"categories":[],"sub_categories":[],"readme":"# sam2-playground\nGradio based playground web UI using [facebook/segment-anything-2](https://github.com/facebookresearch/segment-anything-2) models.\n\n### Online Demos\n\n[![colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/jhj0517/sam2-playground/blob/master/notebooks/sam2_playground.ipynb)\n[![huggingface](https://img.shields.io/badge/Hugging%20Face-%F0%9F%A4%97%20Spaces-orange?logo=huggingface\u0026labelColor=FFFFE0)](https://huggingface.co/spaces/jhj0517/sam2-playground)\n\n## Feature\n- Segment video for transparent background or pixelated object\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cstrong\u003eTransparent background\u003c/strong\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cvideo controls autoplay loop src=\"https://github.com/user-attachments/assets/23b7d8b0-8594-4def-b0dc-405bedd53c84\" muted=\"false\"\u003e\u003c/video\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cstrong\u003ePixelate\u003c/strong\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cvideo controls autoplay loop src=\"https://github.com/user-attachments/assets/1749893b-cf90-4407-89d7-9aaf13234dcc\" muted=\"false\"\u003e\u003c/video\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n- Segment image to divide objects into layers and save them as PSD files.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cstrong\u003eDivide clothes into layers and save as PSD file\u003c/strong\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"https://github.com/jhj0517/sam2-playground/blob/master/docs/example_psd_file.png\" alt=\"Example_PSD\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nSee [PROMPT_GUIDE.md](https://github.com/jhj0517/sam2-playground/blob/master/docs/PROMPT_GUIDE.md) to see how to prompt the segmentation parts of the image.\n\n# Installation and Running\n### Prerequisites\nTo run this Web UI, you need these prerequisites. If you don't have them, please install them in the following links :\n\n- `git` : https://git-scm.com/downloads\n- `python=\u003e3.10` : https://www.python.org/downloads/ \n- `FFmpeg` : https://ffmpeg.org/download.html\n \nAfter installing FFmpeg, **make sure to add the `FFmpeg/bin` folder to your system PATH!** \u003cbr\u003e\nAnd for CUDA, if you're not using an Nvidia GPU and CUDA 12.4, edit the [requirements.txt](https://github.com/jhj0517/sam2-playground/blob/master/requirements.txt) to match your environment.\n\n### Option 1 : Running with Shell / Batch Scripts\nThere's a set of shell / batch scripts for installation and running. \n\n1. Download [`sam2-playground-portable.zip`](https://github.com/jhj0517/sam2-playground/releases/tag/v1.0.0) with the file corresponding to your OS and extract its contents. \n2. Run `install.bat` or `install.sh` to install dependencies. (It will create a `venv` directory and install dependencies there.)\n3. Start WebUI with `start-webui.bat` or `start-webui.sh` (It will run `python app.py` after activating the `venv`)\n4. To update, run `update.bat` or `update.sh` (It will run `git pull origin master`)\n\n### Option 2: Docker\n1. Clone the repository\n```\ngit clone https://github.com/jhj0517/sam2-playground.git\n```\n3. Build the image ( Image is about ~6 GB )\n```\ndocker compose build\n```\n3. Run the container\n```\ndocker compose up\n```\n4. Connect to `localhost:7860` with your browser.\n\nIf needed, update [`docker-compose.yaml`](https://github.com/jhj0517/sam2-playground/blob/master/docker-compose.yaml) to match your environments.\n\n## Todo 🗓\n- [ ] Support `change()` API for `gradio_image_prompter` and automatically generate preview for video predictor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhj0517%2Fsam2-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhj0517%2Fsam2-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhj0517%2Fsam2-playground/lists"}