From f3826f7777f841aef7c40102194f621c9b449ad0 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Wed, 5 Nov 2025 16:49:19 +0100 Subject: [PATCH 01/14] Update setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 70c4bbb..b58cd50 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ package_dir= { "fastsam": "fastsam", "fastsam_tools": "utils", + "fastsam_ultralytics": "ultralytics }, url="https://github.com/CASIA-IVA-Lab/FastSAM" ) From 3dd242e05634521f1d6a5e864bb9ba54ccafa4b8 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Wed, 5 Nov 2025 16:50:33 +0100 Subject: [PATCH 02/14] Add weights_only parameter to torch.load --- ultralytics/nn/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/nn/tasks.py b/ultralytics/nn/tasks.py index 3c2ba06..c356a5d 100644 --- a/ultralytics/nn/tasks.py +++ b/ultralytics/nn/tasks.py @@ -515,7 +515,7 @@ def torch_safe_load(weight): check_suffix(file=weight, suffix='.pt') file = attempt_download_asset(weight) # search online if missing locally try: - return torch.load(file, map_location='cpu'), file # load + return torch.load(file, map_location='cpu', weights_only=False), file # load except ModuleNotFoundError as e: # e.name is missing module name if e.name == 'models': raise TypeError( From 1ca38bceeace99b0d31a0cec1ed06135dcd3d55f Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Wed, 5 Nov 2025 16:53:33 +0100 Subject: [PATCH 03/14] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b58cd50..b82bcfc 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ package_dir= { "fastsam": "fastsam", "fastsam_tools": "utils", - "fastsam_ultralytics": "ultralytics + "fastsam_ultralytics": "ultralytics" }, url="https://github.com/CASIA-IVA-Lab/FastSAM" ) From 46eb30a90c09f015e32e039d6d6465496a597045 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Thu, 6 Nov 2025 10:53:01 +0100 Subject: [PATCH 04/14] Update torch.load to include weights_only parameter --- ultralytics/nn/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/nn/tasks.py b/ultralytics/nn/tasks.py index c356a5d..debcc80 100644 --- a/ultralytics/nn/tasks.py +++ b/ultralytics/nn/tasks.py @@ -530,7 +530,7 @@ def torch_safe_load(weight): f"run a command with an official YOLOv8 model, i.e. 'yolo predict model=yolov8n.pt'") check_requirements(e.name) # install missing module - return torch.load(file, map_location='cpu'), file # load + return torch.load(file, map_location='cpu', weights_only=False), file # load def attempt_load_weights(weights, device=None, inplace=True, fuse=False): From bb496af2223af06d2fc78feb2041ca5f17abcdd6 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Thu, 6 Nov 2025 10:56:58 +0100 Subject: [PATCH 05/14] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b82bcfc..e19562f 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ package_dir= { "fastsam": "fastsam", "fastsam_tools": "utils", - "fastsam_ultralytics": "ultralytics" + "ultralytics": "ultralytics" }, url="https://github.com/CASIA-IVA-Lab/FastSAM" ) From 1e5a476d0e77504958ff6756f5c86fa27df08d24 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Thu, 6 Nov 2025 10:59:09 +0100 Subject: [PATCH 06/14] Update requirements.txt to include ultralytics --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b40e8ff..1e0e813 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,5 +15,6 @@ seaborn>=0.11.0 gradio==3.35.2 # Ultralytics----------------------------------- -# ultralytics == 8.0.120 +ultralytics == 8.0.120 + From ec36862f3a7b9a42714c43a9c0e914c9f3adbfe5 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Thu, 6 Nov 2025 11:01:38 +0100 Subject: [PATCH 07/14] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1e0e813..5f4169a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,6 +15,7 @@ seaborn>=0.11.0 gradio==3.35.2 # Ultralytics----------------------------------- -ultralytics == 8.0.120 +ultralytics == 8.3.255 + From 99e47633d4cff8f84ccd039be389d19a365dad98 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard <68589761+hh4000@users.noreply.github.com> Date: Thu, 6 Nov 2025 11:02:24 +0100 Subject: [PATCH 08/14] Change ultralytics version to 8.3.225 Updated the version of the ultralytics package. --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5f4169a..0890c66 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,8 @@ seaborn>=0.11.0 gradio==3.35.2 # Ultralytics----------------------------------- -ultralytics == 8.3.255 +ultralytics == 8.3.225 + From 1995605c93a6f59f653036500f95d7ea9b9318dc Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard Date: Thu, 6 Nov 2025 11:07:59 +0100 Subject: [PATCH 09/14] update setup --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1e0e813..b555881 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,6 +15,6 @@ seaborn>=0.11.0 gradio==3.35.2 # Ultralytics----------------------------------- -ultralytics == 8.0.120 +# ultralytics == 8.0.120 diff --git a/setup.py b/setup.py index e19562f..754bec1 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name="fastsam", version="0.1.1", install_requires=REQUIREMENTS, - packages=["fastsam", "fastsam_tools"], + packages=["fastsam", "fastsam_tools", "ultralytics"], package_dir= { "fastsam": "fastsam", "fastsam_tools": "utils", From 0997b038181f9762e7ae6e53970749148c74fa8f Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard Date: Thu, 6 Nov 2025 11:22:36 +0100 Subject: [PATCH 10/14] update setup --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b555881..576db96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ tqdm>=4.64.0 pandas>=1.1.4 seaborn>=0.11.0 - +psutil == 7.1.3 gradio==3.35.2 # Ultralytics----------------------------------- From 05ad92acac15b4e9b7e289ae325d7783a165abfd Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard Date: Thu, 6 Nov 2025 11:34:34 +0100 Subject: [PATCH 11/14] update setup --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 754bec1..4b616db 100644 --- a/setup.py +++ b/setup.py @@ -15,8 +15,8 @@ packages=["fastsam", "fastsam_tools", "ultralytics"], package_dir= { "fastsam": "fastsam", - "fastsam_tools": "utils", - "ultralytics": "ultralytics" + "fastsam_tools": "utils.*", + "ultralytics": "ultralytics.*" }, url="https://github.com/CASIA-IVA-Lab/FastSAM" ) From 77d33f8d338aa8b49ce3d34a65e356aca06b46b3 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard Date: Thu, 6 Nov 2025 11:35:48 +0100 Subject: [PATCH 12/14] update setup --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4b616db..b7ae8d8 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ packages=["fastsam", "fastsam_tools", "ultralytics"], package_dir= { "fastsam": "fastsam", - "fastsam_tools": "utils.*", + "fastsam_tools": "utils", "ultralytics": "ultralytics.*" }, url="https://github.com/CASIA-IVA-Lab/FastSAM" From cc3fb371d7bb7bf9dbed84ffb5c2b9b9da6b7692 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard Date: Thu, 6 Nov 2025 11:42:44 +0100 Subject: [PATCH 13/14] update setup --- setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index b7ae8d8..495c684 100644 --- a/setup.py +++ b/setup.py @@ -12,11 +12,13 @@ name="fastsam", version="0.1.1", install_requires=REQUIREMENTS, - packages=["fastsam", "fastsam_tools", "ultralytics"], - package_dir= { - "fastsam": "fastsam", - "fastsam_tools": "utils", - "ultralytics": "ultralytics.*" - }, + packages=find_packages( + where='.', + include=[ + 'fastsam', # include only top-level fastsam + 'utils', # include only top-level utils + 'ultralytics*', # include ultralytics and all its subpackages + ], + ), url="https://github.com/CASIA-IVA-Lab/FastSAM" ) From d6738a16a1be99a0c0e4cc5fc80184cc9831a1e8 Mon Sep 17 00:00:00 2001 From: Hans Henrik Dalgaard Date: Thu, 6 Nov 2025 11:46:15 +0100 Subject: [PATCH 14/14] update setup --- MANIFEST.in | 3 +++ setup.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..e915c3a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +recursive-include ultralytics *.yaml +recursive-include ultralytics *.txt +recursive-include ultralytics *.json diff --git a/setup.py b/setup.py index 495c684..752aa78 100644 --- a/setup.py +++ b/setup.py @@ -20,5 +20,8 @@ 'ultralytics*', # include ultralytics and all its subpackages ], ), - url="https://github.com/CASIA-IVA-Lab/FastSAM" + url="https://github.com/CASIA-IVA-Lab/FastSAM", + include_package_data=True, + package_data={'ultralytics': ['**/*.yaml', '**/*.txt', '**/*.json']} + )