Commit Graph

200 Commits

Author SHA1 Message Date
rentainhe
3a0089e7cb refine README 2024-08-09 09:36:03 +08:00
Ren Tianhe
0ba553bf88 Merge pull request #6 from ShuoShenDe/main
feat: create grounded_sam2_tracking_demo_with_continuous_id.py
2024-08-09 09:17:01 +08:00
bd8090
f22e6bde05 fix:update README 2024-08-09 02:54:02 +02:00
bd8090
d0c10627be fix:update README 2024-08-09 02:51:41 +02:00
bd8090
b99e0f7ee4 update README 2024-08-09 02:41:29 +02:00
bd8090
df626551c4 feat: add grounded_sam2_tracking_demo_with_continuous_id.py and test data 2024-08-09 02:33:24 +02:00
Ronghang Hu
d421e0b040 add Colab support to the notebooks; pack config files in sam2_configs package during installation (#176) 2024-08-08 11:03:22 -07:00
rentainhe
80676e866b fix mask shape bug 2024-08-09 01:54:40 +08:00
rentainhe
9c5786fc09 update 2024-08-09 01:36:12 +08:00
rentainhe
fda8e8af23 refine Grounded-SAM-2 to Grounded SAM 2 2024-08-09 01:35:38 +08:00
Ren Tianhe
fd89106349 Update README.md 2024-08-08 18:00:02 +08:00
Arun
102ddb8899 Merge branch 'main' into patch-1 2024-08-08 09:59:47 +05:30
rentainhe
04ad096725 support more prompt in simple demo 2024-08-08 12:26:59 +08:00
rentainhe
223df6c912 add new tracking pipeline vis 2024-08-08 12:15:58 +08:00
rentainhe
87dc52d968 refine README 2024-08-08 12:15:42 +08:00
rentainhe
21c1002e66 Merge branch 'main' of github.com:IDEA-Research/Grounded-SAM-2 into main 2024-08-08 12:03:46 +08:00
rentainhe
077064c365 update to the latest sam2 version and support box prompts in video tracking 2024-08-08 12:03:29 +08:00
Ronghang Hu
6186d1529a also catch errors during installation in case CUDAExtension cannot be loaded (#175)
Previously we only catch build errors in `BuildExtension` in https://github.com/facebookresearch/segment-anything-2/pull/155. However, in some cases, the `CUDAExtension` instance might not load. So in this PR, we also catch such errors for `CUDAExtension`.
2024-08-07 12:26:11 -07:00
Ronghang Hu
6ecb5ff8d0 Add interface for box prompt in SAM 2 video predictor (#174)
This PR adds an example to provide box prompt in SAM 2 as inputs to the `add_new_points_or_box` API (renamed from`add_new_points`, which is kept for backward compatibility). If `box` is provided, we add it as the first two points with labels 2 and 3, along with the user-provided points (consistent with how SAM 2 is trained).

The video predictor notebook `notebooks/video_predictor_example.ipynb` is updated to include segmenting from box prompt as an example.
2024-08-07 11:54:30 -07:00
Arun
086daf0641 Merge branch 'main' into patch-1 2024-08-07 21:50:26 +05:30
Ren Tianhe
c3159ee2f3 Merge pull request #2 from eltociear/patch-1
docs: update README.md
2024-08-08 00:14:50 +08:00
Ikko Eltociear Ashimine
837d871442 docs: update README.md
initilize -> initialize
2024-08-08 01:04:53 +09:00
Haitham Khedr
6ba4c65cb2 Merge pull request #128 from NielsRogge/add_hf
Integrate with Hugging Face
2024-08-07 08:54:49 -07:00
Niels
9b58611e24 Address comment 2024-08-07 17:48:12 +02:00
rentainhe
96cbab92e0 support gd1.0 tracking demo with custom input 2024-08-07 17:14:46 +08:00
rentainhe
ce0fc19c98 refine pipeline vis 2024-08-07 16:51:12 +08:00
rentainhe
a1b3cc3af6 refine README 2024-08-07 16:46:00 +08:00
rentainhe
31ec9420d8 refine README 2024-08-07 16:45:03 +08:00
rentainhe
37cf27cfe3 support mask prompt for video tracking 2024-08-07 16:42:49 +08:00
rentainhe
7c0995e9c3 refine file name 2024-08-07 15:51:24 +08:00
Arun
6ec8560436 Update hieradet.py
Not used  
head_dim = dim_out // num_heads
self.scale = head_dim**-0.5

F.scaled_dot_product_attention takes care of this automatically.
2024-08-07 11:35:46 +05:30
Ren Tianhe
7303af7250 Update Intro Video 2024-08-07 10:30:18 +08:00
Niels
43c385c263 Update docstrings 2024-08-06 23:00:26 +02:00
Niels
322aa3e7e5 Revert code snippet 2024-08-06 22:57:07 +02:00
Diego Garcia
511199d7a9 Updated INSTALL.md with CUDA_HOME-related troubleshooting (#140)
This is referring to https://github.com/facebookresearch/segment-anything-2/issues/137 , which in itself refers to a common problem during installation, mentioned on https://github.com/facebookresearch/segment-anything-2/issues/19 .

Some users may encounter significant trouble installing the project, running into the error `OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.`. Simply adding the `--no-build-isolation` flag to the pip install, e.g. `pip install --no-build-isolation -e .`, usually solves this problem. However, this fix is not mentioned anywhere within the readmes or installation troubleshooting docs. This PR adds this recommendation into the INSTALL.md file under the "My installation failed with `CUDA_HOME environment variable is not set` " section, ensuring that more users are aware of this potential fix.

Examples of users experiencing related difficulties when installing:
https://github.com/facebookresearch/segment-anything-2/issues/19
https://github.com/facebookresearch/segment-anything-2/issues/41
https://github.com/facebookresearch/segment-anything-2/issues/99
https://github.com/facebookresearch/segment-anything-2/issues/133
2024-08-06 13:45:15 -07:00
Niels
8f15c6255a Format using ufmt 2024-08-06 22:43:35 +02:00
jhj0517
0bac418736 Update INSTALL.md (#156)
This PR suggests a way to resolve the error of `unsupported Microsoft Visual Studio version!` in INSTALL.md.
Adding `-allow-unsupported-compiler` argument for the `nvcc` worked. 

Editing [setup.py](https://github.com/facebookresearch/segment-anything-2/blob/main/setup.py) is required to add the `-allow-unsupported-compiler` argument for `nvcc`.

```python
def get_extensions():
    srcs = ["sam2/csrc/connected_components.cu"]
    compile_args = {
        "cxx": [],
        "nvcc": [
            "-DCUDA_HAS_FP16=1",
            "-D__CUDA_NO_HALF_OPERATORS__",
            "-D__CUDA_NO_HALF_CONVERSIONS__",
            "-D__CUDA_NO_HALF2_OPERATORS__",
            "-allow-unsupported-compiler"  # Add this argument
        ],
    }
    ext_modules = [CUDAExtension("sam2._C", srcs, extra_compile_args=compile_args)]
    return ext_modules
```
2024-08-06 13:43:12 -07:00
Niels
27a167c004 Update README 2024-08-06 22:41:32 +02:00
Ronghang Hu
6f7e700c37 Make it optional to build CUDA extension for SAM 2; also fallback to all available kernels if Flash Attention fails (#155)
In this PR, we make it optional to build the SAM 2 CUDA extension, in observation that many users encounter difficulties with the CUDA compilation step.
1. During installation, we catch build errors and print a warning message. We also allow explicitly turning off the CUDA extension building with `SAM2_BUILD_CUDA=0`.
2. At runtime, we catch CUDA kernel errors from connected components and print a warning on skipping the post processing step.

We also fall back to the all available kernels if the Flash Attention kernel fails.
2024-08-06 10:52:01 -07:00
Ren Tianhe
aa7913cd6c Update README.md 2024-08-06 22:29:50 +08:00
rentainhe
858d955647 refine video 2024-08-06 18:30:57 +08:00
rentainhe
ad62ac6c09 refine README 2024-08-06 17:34:13 +08:00
rentainhe
e990003497 add demo video 2024-08-06 17:26:31 +08:00
rentainhe
231d213c58 support custom video input and tracking 2024-08-06 17:11:55 +08:00
Niels
a36edf1e01 Clean up 2024-08-06 08:34:42 +02:00
Niels
e815f70a38 Address comment 2024-08-06 08:32:36 +02:00
Niels
fbf7e3a664 Add link 2024-08-05 22:12:15 +02:00
Niels
e9503c96fe Move HF to separate section 2024-08-05 22:10:57 +02:00
Niels
c3393d8b5f Include original code snippet 2024-08-05 22:08:54 +02:00
rentainhe
731955be0f update README 2024-08-06 03:08:06 +08:00