Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 2.06 KB

README.md

File metadata and controls

83 lines (58 loc) · 2.06 KB

Colab

SAM2-in-Video

This repository contains code for deploying a Gradio application using the SAM2 model for video processing. The application allows users to interact with the model through a user-friendly web interface.

Demo

demo

Table of Contents

Installation

To set up the project locally, follow these steps:

  1. Clone the GitHub repository:

    git clone https://github.com/sujanshresstha/sam2-in-video.git
    cd sam2-in-video
  2. Install the necessary dependencies:

    pip install -e .
    pip install -q -r requirements.txt
  3. Build the project:

    python setup.py build_ext --inplace
  4. Download the necessary model checkpoints:

    cd checkpoints
    ./download_ckpts.sh
    cd ..

Usage

To run the Gradio application:

  1. Make sure you are in the root directory of the cloned repository.
  2. Run the gradio_app.py script:
    python gradio_app.py

This will launch the Gradio interface, where you can interact with the SAM2 model.

Running the Jupyter Notebook

Alternatively, you can run the entire setup and launch the Gradio app through the provided Jupyter Notebook:

  1. Open the gradio_app.ipynb file in Jupyter Notebook or JupyterLab.
  2. Execute the cells sequentially to set up the environment and launch the app.

Files

  • gradio_app.ipynb: A Jupyter Notebook containing steps to set up the environment and run the Gradio application.
  • gradio_app.py: A Python script that contains the Gradio interface and the necessary backend logic for model inference.

Dependencies

This project requires the following dependencies:

  • Python 3.7 or higher
  • PyTorch
  • Gradio
  • OpenCV
  • Matplotlib
  • PIL