Commit Graph

24 Commits

Author SHA1 Message Date
Ronghang Hu
7e1596c0b6 open README.md with unicode (to support Hugging Face emoji); fix various typos (#218)
(close #217, #66, #67, #69, #91, #126, #127, #145)
2024-08-14 09:06:25 -07:00
Haitham Khedr
fd5125b97a accept kwargs in auto_mask_generator 2024-08-13 00:02:36 +00:00
Haitham Khedr
1191677e1e Fix HF image predictor 2024-08-12 23:41:41 +00:00
Ronghang Hu
dce7b5446f improving warning message and adding further tips for installation (#204) 2024-08-12 11:37:41 -07:00
Ronghang Hu
1034ee2a1a better support for non-CUDA devices (CPU, MPS) (#192) 2024-08-12 10:46:50 -07:00
Arun
46945a2122 Update hieradet.py
ufmt formatting fixed.
2024-08-09 11:14:11 +05:30
Arun
102ddb8899 Merge branch 'main' into patch-1 2024-08-08 09:59:47 +05:30
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
Haitham Khedr
6ba4c65cb2 Merge pull request #128 from NielsRogge/add_hf
Integrate with Hugging Face
2024-08-07 08:54:49 -07: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
Niels
43c385c263 Update docstrings 2024-08-06 23:00:26 +02:00
Niels
8f15c6255a Format using ufmt 2024-08-06 22:43:35 +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
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
841cc1f015 Update docstring 2024-08-05 09:44:03 +02:00
Niels
6aeee34775 Make huggingface_hub soft dependency 2024-08-05 09:37:53 +02:00
Niels
0c28c630c2 Do not load config from the hub 2024-08-03 14:45:20 +02:00
Niels
3af4e82263 Add model_id_to_filenames 2024-08-03 14:18:23 +02:00
Niels
17b74501fb Use classmethod 2024-08-03 14:14:12 +02:00
Niels
b72a8a97f0 First draft 2024-08-03 12:57:05 +02:00
CharlesCNorton
f882beb157 fix: correct spelling
Corrected two instances of "a even number" to "an even number" for correct article usage before a vowel sound.
2024-07-30 08:13:47 -04:00
Haitham Khedr
0c5f8c5432 Initial commit 2024-07-29 21:54:20 +00:00