From 8505a128f5b9240cce8559aaad38db39d45ae64e Mon Sep 17 00:00:00 2001 From: yasserelj Date: Thu, 1 Aug 2024 13:18:27 +0100 Subject: [PATCH 1/6] changes --- sam2/modeling/sam/transformer.py | 4 ++++ setup.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sam2/modeling/sam/transformer.py b/sam2/modeling/sam/transformer.py index 2a0b7960..f01e12ec 100644 --- a/sam2/modeling/sam/transformer.py +++ b/sam2/modeling/sam/transformer.py @@ -21,6 +21,10 @@ warnings.simplefilter(action="ignore", category=FutureWarning) OLD_GPU, USE_FLASH_ATTN, MATH_KERNEL_ON = get_sdpa_settings() +USE_FLASH_ATTN = False +MATH_KERNEL_ON = True +OLD_GPU = True + class TwoWayTransformer(nn.Module): def __init__( diff --git a/setup.py b/setup.py index 85ae842f..4a5d7d91 100644 --- a/setup.py +++ b/setup.py @@ -69,4 +69,8 @@ def get_extensions(): python_requires=">=3.10.0", ext_modules=get_extensions(), cmdclass={"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}, + include_package_data=True, + package_data={ + "sam2": ["sam2_configs/*"], + }, ) From c9beb1eade0dbc2bb2599e8914588259aceaafde Mon Sep 17 00:00:00 2001 From: yasserelj Date: Thu, 1 Aug 2024 13:26:59 +0100 Subject: [PATCH 2/6] configs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4a5d7d91..e3eaed21 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,6 @@ def get_extensions(): cmdclass={"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}, include_package_data=True, package_data={ - "sam2": ["sam2_configs/*"], + "sam2_configs": ["*.yaml"], }, ) From 4e6adcc64bbe138417d81ef0106f7f8c32e5bd46 Mon Sep 17 00:00:00 2001 From: yasserelj Date: Thu, 1 Aug 2024 13:56:02 +0100 Subject: [PATCH 3/6] change installation command --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 26c90273..34ffc857 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,8 @@ Please install SAM 2 on a GPU machine using: ```bash -git clone https://github.com/facebookresearch/segment-anything-2.git - -cd segment-anything-2; pip install -e . +pip install git+https://github.com/facebookresearch/segment-anything-2.git +. ``` To use the SAM 2 predictor and run the example notebooks, `jupyter` and `matplotlib` are required and can be installed by: From 4651e38bd956678e107707baf2ce4043e5dc720f Mon Sep 17 00:00:00 2001 From: YasserElj <61060853+YasserElj@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:27:27 +0100 Subject: [PATCH 4/6] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 34ffc857..ac7d65a4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Please install SAM 2 on a GPU machine using: ```bash pip install git+https://github.com/facebookresearch/segment-anything-2.git -. ``` To use the SAM 2 predictor and run the example notebooks, `jupyter` and `matplotlib` are required and can be installed by: From 3a79e7b12319240c391ae10ebd247fe4df0e51d0 Mon Sep 17 00:00:00 2001 From: yasserelj Date: Mon, 5 Aug 2024 16:14:54 +0100 Subject: [PATCH 5/6] changes --- sam2/modeling/sam/transformer.py | 6 +----- setup.py | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/sam2/modeling/sam/transformer.py b/sam2/modeling/sam/transformer.py index f01e12ec..122b9dd5 100644 --- a/sam2/modeling/sam/transformer.py +++ b/sam2/modeling/sam/transformer.py @@ -19,11 +19,7 @@ from sam2.utils.misc import get_sdpa_settings warnings.simplefilter(action="ignore", category=FutureWarning) -OLD_GPU, USE_FLASH_ATTN, MATH_KERNEL_ON = get_sdpa_settings() - -USE_FLASH_ATTN = False -MATH_KERNEL_ON = True -OLD_GPU = True +OLD_GPU, USE_FLASH_ATTN, MATH_KERNEL_ON = True, True, True class TwoWayTransformer(nn.Module): diff --git a/setup.py b/setup.py index e3eaed21..85ae842f 100644 --- a/setup.py +++ b/setup.py @@ -69,8 +69,4 @@ def get_extensions(): python_requires=">=3.10.0", ext_modules=get_extensions(), cmdclass={"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}, - include_package_data=True, - package_data={ - "sam2_configs": ["*.yaml"], - }, ) From 3b817cc4bf68b1ea336c562edde7ec15dbae9a71 Mon Sep 17 00:00:00 2001 From: yasserelj Date: Tue, 6 Aug 2024 15:57:01 +0100 Subject: [PATCH 6/6] YAML --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 85ae842f..e3eaed21 100644 --- a/setup.py +++ b/setup.py @@ -69,4 +69,8 @@ def get_extensions(): python_requires=">=3.10.0", ext_modules=get_extensions(), cmdclass={"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}, + include_package_data=True, + package_data={ + "sam2_configs": ["*.yaml"], + }, )