diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3e41ede..41e66f37 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -147,7 +147,6 @@ jobs: run: | python -m pip install --upgrade pip wheel pip install -e ".[export]" "coverage[toml]" --extra-index-url https://download.pytorch.org/whl/cpu - # yolo export format=tflite imgsz=32 || true - name: Check environment run: | yolo checks diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 338d4679..e4464bec 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,11 +1,14 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.23" +__version__ = "8.2.24" + +import os + +# Set ENV Variables (place before imports) +os.environ["OMP_NUM_THREADS"] = "1" # reduce CPU utilization during training from ultralytics.data.explorer.explorer import Explorer -from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld -from ultralytics.models.fastsam import FastSAM -from ultralytics.models.nas import NAS +from ultralytics.models import NAS, RTDETR, SAM, YOLO, FastSAM, YOLOWorld from ultralytics.utils import ASSETS, SETTINGS from ultralytics.utils.checks import check_yolo as checks from ultralytics.utils.downloads import download diff --git a/ultralytics/data/explorer/explorer.py b/ultralytics/data/explorer/explorer.py index 1982ca03..11c54c2f 100644 --- a/ultralytics/data/explorer/explorer.py +++ b/ultralytics/data/explorer/explorer.py @@ -64,7 +64,7 @@ class Explorer: import lancedb self.connection = lancedb.connect(uri) - self.table_name = Path(data).name.lower() + "_" + model.lower() + self.table_name = f"{Path(data).name.lower()}_{model.lower()}" self.sim_idx_base_name = ( f"{self.table_name}_sim_idx".lower() ) # Use this name and append thres and top_k to reuse the table @@ -268,10 +268,7 @@ class Explorer: similar = exp.get_similar(img='https://ultralytics.com/images/zidane.jpg') ``` """ - assert return_type in { - "pandas", - "arrow", - }, f"Return type should be either `pandas` or `arrow`, but got {return_type}" + assert return_type in {"pandas", "arrow"}, f"Return type should be `pandas` or `arrow`, but got {return_type}" img = self._check_imgs_or_idxs(img, idx) similar = self.query(img, limit=limit) diff --git a/ultralytics/data/explorer/gui/dash.py b/ultralytics/data/explorer/gui/dash.py index a53144d8..eeb8d15d 100644 --- a/ultralytics/data/explorer/gui/dash.py +++ b/ultralytics/data/explorer/gui/dash.py @@ -197,12 +197,11 @@ def layout(): imgs = [] if st.session_state.get("error"): st.error(st.session_state["error"]) + elif st.session_state.get("imgs"): + imgs = st.session_state.get("imgs") else: - if st.session_state.get("imgs"): - imgs = st.session_state.get("imgs") - else: - imgs = exp.table.to_lance().to_table(columns=["im_file"]).to_pydict()["im_file"] - st.session_state["res"] = exp.table.to_arrow() + imgs = exp.table.to_lance().to_table(columns=["im_file"]).to_pydict()["im_file"] + st.session_state["res"] = exp.table.to_arrow() total_imgs, selected_imgs = len(imgs), [] with col1: subcol1, subcol2, subcol3, subcol4, subcol5 = st.columns(5) diff --git a/ultralytics/models/__init__.py b/ultralytics/models/__init__.py index b9b6eb35..aff620a9 100644 --- a/ultralytics/models/__init__.py +++ b/ultralytics/models/__init__.py @@ -1,7 +1,9 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license +from .fastsam import FastSAM +from .nas import NAS from .rtdetr import RTDETR from .sam import SAM from .yolo import YOLO, YOLOWorld -__all__ = "YOLO", "RTDETR", "SAM", "YOLOWorld" # allow simpler import +__all__ = "YOLO", "RTDETR", "SAM", "FastSAM", "NAS", "YOLOWorld" # allow simpler import