{ "cells": [ { "cell_type": "markdown", "source": [ "---\n", "\n", "📌 **This notebook has been updated [here](https://github.com/jhj0517/sam2-playground)!**\n", "\n", "🖋 **Author**: [jhj0517](https://github.com/jhj0517/sam2-playground/blob/master/notebooks/sam2-playground.ipynb)\n", "\n", "😎 **Support the Project**:\n", "\n", "If you find this project useful, please consider supporting it:\n", "\n", "\n", " \"Buy\n", "\n", "\n", "---" ], "metadata": { "id": "doKhBBXIfS21" } }, { "cell_type": "code", "source": [ "#@title #(Optional) Check GPU\n", "#@markdown Some models may not function correctly on a CPU runtime.\n", "\n", "#@markdown so you should check your GPU setup before run.\n", "!nvidia-smi" ], "metadata": { "id": "23yZvUlagEsx", "cellView": "form" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "kNbSbsctxahq" }, "outputs": [], "source": [ "#@title #Installation\n", "#@markdown This cell will install dependencies for Whisper-WebUI!\n", "!git clone https://github.com/jhj0517/sam2-playground.git\n", "%cd sam2-playground\n", "!pip install gradio\n", "!pip install git+https://github.com/jhj0517/gradio-image-prompter.git\n", "!pip install git+https://github.com/jhj0517/segment-anything-2.git\n", "!pip install git+https://github.com/jhj0517/forked-pytoshop.git\n", "!pip install packbits\n", "!pip install hydra-core\n", "!pip install -U numpy==1.26.4" ] }, { "cell_type": "code", "source": [ "#@title # (Optional) Configure arguments\n", "#@markdown This section is used to configure some command line arguments.\n", "\n", "#@markdown You can simply ignore this section and the default values will be used.\n", "THEME = '' #@param {type: \"string\"}\n", "\n", "arguments = \"\"\n", "if THEME:\n", " arguments += f\" --theme {THEME}\"" ], "metadata": { "id": "Qosz9BFlGui3", "cellView": "form" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "PQroYRRZzQiN", "cellView": "form" }, "outputs": [], "source": [ "#@title #Run\n", "#@markdown Once the installation is complete, you can use public URL that is displayed.\n", "if 'arguments' in locals():\n", " !python app.py --share {arguments}\n", "else:\n", " !python app.py --share" ] } ], "metadata": { "colab": { "provenance": [], "gpuType": "T4" }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" }, "accelerator": "GPU" }, "nbformat": 4, "nbformat_minor": 0 }