Skip to content
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include ultralytics *.yaml
recursive-include ultralytics *.txt
recursive-include ultralytics *.json
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ tqdm>=4.64.0

pandas>=1.1.4
seaborn>=0.11.0

psutil == 7.1.3
gradio==3.35.2

# Ultralytics-----------------------------------
# ultralytics == 8.0.120


18 changes: 12 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
name="fastsam",
version="0.1.1",
install_requires=REQUIREMENTS,
packages=["fastsam", "fastsam_tools"],
package_dir= {
"fastsam": "fastsam",
"fastsam_tools": "utils",
},
url="https://github.com/CASIA-IVA-Lab/FastSAM"
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",
include_package_data=True,
package_data={'ultralytics': ['**/*.yaml', '**/*.txt', '**/*.json']}

)
4 changes: 2 additions & 2 deletions ultralytics/nn/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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):
Expand Down