From 0f48470ec31ce0fe44920b813fdbb3be6acc9620 Mon Sep 17 00:00:00 2001 From: SusanSHEN Date: Fri, 9 Aug 2024 22:39:52 +0200 Subject: [PATCH] update README --- Makefile | 10 ---------- README.md | 36 ++++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 15157f1..7aab9ed 100644 --- a/Makefile +++ b/Makefile @@ -23,16 +23,6 @@ else endif -prepare-checkpoints: - @echo "Preparing checkpoints..." - cd checkpoints && \ - bash download_ckpts.sh && \ - mkdir -p gdino_checkpoints && \ - cd gdino_checkpoints && \ - wget https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth && \ - wget https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha2/groundingdino_swinb_cogcoor.pth - - build-image: @echo $(BUILD_MESSAGE) docker build --build-arg USE_CUDA=$(USE_CUDA) \ diff --git a/README.md b/README.md index da18ea0..3fd24d3 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,22 @@ Grounded SAM 2 does not introduce significant methodological changes compared to ## Installation +Download the pretrained `SAM 2` checkpoints: + +```bash +cd checkpoints +bash download_ckpts.sh +``` + +Download the pretrained `Grounding DINO` checkpoints: + +```bash +cd gdino_checkpoints +bash download_ckpts.sh +``` + +### Installation without docker + Install PyTorch environment first. We use `python=3.10`, as well as `torch >= 2.3.1`, `torchvision>=0.18.1` and `cuda-12.1` in our environment to run this demo. Please follow the instructions [here](https://pytorch.org/get-started/locally/) to install both PyTorch and TorchVision dependencies. Installing both PyTorch and TorchVision with CUDA support is strongly recommended. You can easily install the latest version of PyTorch as follows: ```bash @@ -56,19 +72,19 @@ Install `Grounding DINO`: pip install --no-build-isolation -e grounding_dino ``` -Download the pretrained `SAM 2` checkpoints: +### Installation with docker +Build the Docker image and Run the Docker container: -```bash -cd checkpoints -bash download_ckpts.sh ``` +cd Grounded-SAM-2 +make build-image +make run +``` +After executing these commands, you will be inside the Docker environment. The working directory within the container is set to: `/home/appuser/Grounded-SAM-2` -Download the pretrained `Grounding DINO` checkpoints: - -```bash -cd gdino_checkpoints -wget https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth -wget https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha2/groundingdino_swinb_cogcoor.pth +Once inside the Docker environment, you can start the demo by running: +``` +python grounded_sam2_tracking_demo.py ``` ## Grounded SAM 2 Demos