upgrade supervision to 0.22.0 and refine custom API usage

This commit is contained in:
rentainhe
2024-08-06 01:59:27 +08:00
parent ed4c128a4e
commit 6915725120
7 changed files with 66 additions and 22 deletions

View File

@@ -41,12 +41,6 @@ Install `Grounding DINO`:
pip install --no-build-isolation -e grounding_dino
```
Downgrade the version of the `supervision` library to `0.6.0` to use its original API for visualization (we will update our code to be compatible with the latest version of `supervision` in the future release):
```bash
pip install supervision==0.6.0
```
Download the pretrained `SAM 2` checkpoints:
```bash
@@ -71,12 +65,16 @@ Note that `Grounding DINO` has already been supported in [Huggingface](https://h
python grounded_sam2_hf_model_demo.py
```
> [!NOTE]
> 🚨 If you encounter network issues while using the `HuggingFace` model, you can resolve them by setting the appropriate mirror source as `export HF_ENDPOINT=https://hf-mirror.com`
- Load local pretrained Grounding DINO checkpoint and inference with Grounding DINO original API (make sure you've already downloaded the pretrained checkpoint)
```bash
python grounded_sam2_local_demo.py
```
### Grounded-SAM-2 Image Demo (with Grounding DINO 1.5 & 1.6)
We've already released our most capable open-set detection model [Grounding DINO 1.5 & 1.6](https://github.com/IDEA-Research/Grounding-DINO-1.5-API), which can be combined with SAM 2 for stronger open-set detection and segmentation capability. You can apply the API token first and run Grounded-SAM-2 with Grounding DINO 1.5 as follows: