Skip to content

Commit

Permalink
ultralytics 8.2.24 set ENV OMP_NUM_THREADS=1 (ultralytics#13158)
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Jocher <[email protected]>
Co-authored-by: UltralyticsAssistant <[email protected]>
  • Loading branch information
glenn-jocher and UltralyticsAssistant authored May 28, 2024
1 parent 15975e4 commit 8caa1c9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions ultralytics/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 2 additions & 5 deletions ultralytics/data/explorer/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
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
Expand Down Expand Up @@ -268,10 +268,7 @@ def get_similar(
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)

Expand Down
9 changes: 4 additions & 5 deletions ultralytics/data/explorer/gui/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion ultralytics/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8caa1c9

Please sign in to comment.