ultralytics 8.2.61__py3-none-any.whl → 8.2.63__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ultralytics might be problematic. Click here for more details.
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/__init__.py +154 -103
- ultralytics/data/annotator.py +16 -12
- ultralytics/data/augment.py +1478 -195
- ultralytics/data/explorer/gui/dash.py +41 -26
- ultralytics/data/loaders.py +1 -1
- ultralytics/engine/model.py +483 -176
- ultralytics/engine/results.py +1035 -256
- ultralytics/models/fastsam/predict.py +18 -73
- ultralytics/models/fastsam/utils.py +0 -42
- ultralytics/models/nas/predict.py +1 -3
- ultralytics/models/rtdetr/predict.py +4 -6
- ultralytics/models/sam/predict.py +1 -3
- ultralytics/models/yolo/classify/predict.py +1 -3
- ultralytics/models/yolo/detect/predict.py +1 -3
- ultralytics/models/yolo/pose/predict.py +1 -3
- ultralytics/models/yolo/segment/predict.py +1 -3
- ultralytics/solutions/streamlit_inference.py +5 -2
- ultralytics/utils/downloads.py +1 -1
- {ultralytics-8.2.61.dist-info → ultralytics-8.2.63.dist-info}/METADATA +1 -1
- {ultralytics-8.2.61.dist-info → ultralytics-8.2.63.dist-info}/RECORD +25 -25
- {ultralytics-8.2.61.dist-info → ultralytics-8.2.63.dist-info}/WHEEL +1 -1
- {ultralytics-8.2.61.dist-info → ultralytics-8.2.63.dist-info}/LICENSE +0 -0
- {ultralytics-8.2.61.dist-info → ultralytics-8.2.63.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.2.61.dist-info → ultralytics-8.2.63.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
2
|
|
|
3
|
+
import sys
|
|
3
4
|
import time
|
|
4
5
|
from threading import Thread
|
|
5
6
|
|
|
@@ -17,7 +18,8 @@ def _get_explorer():
|
|
|
17
18
|
"""Initializes and returns an instance of the Explorer class."""
|
|
18
19
|
exp = Explorer(data=st.session_state.get("dataset"), model=st.session_state.get("model"))
|
|
19
20
|
thread = Thread(
|
|
20
|
-
target=exp.create_embeddings_table,
|
|
21
|
+
target=exp.create_embeddings_table,
|
|
22
|
+
kwargs={"force": st.session_state.get("force_recreate_embeddings"), "split": st.session_state.get("split")},
|
|
21
23
|
)
|
|
22
24
|
thread.start()
|
|
23
25
|
progress_bar = st.progress(0, text="Creating embeddings table...")
|
|
@@ -29,33 +31,45 @@ def _get_explorer():
|
|
|
29
31
|
progress_bar.empty()
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
def init_explorer_form():
|
|
34
|
+
def init_explorer_form(data=None, model=None):
|
|
33
35
|
"""Initializes an Explorer instance and creates embeddings table with progress tracking."""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
if data is None:
|
|
37
|
+
datasets = ROOT / "cfg" / "datasets"
|
|
38
|
+
ds = [d.name for d in datasets.glob("*.yaml")]
|
|
39
|
+
else:
|
|
40
|
+
ds = [data]
|
|
41
|
+
|
|
42
|
+
if model is None:
|
|
43
|
+
models = [
|
|
44
|
+
"yolov8n.pt",
|
|
45
|
+
"yolov8s.pt",
|
|
46
|
+
"yolov8m.pt",
|
|
47
|
+
"yolov8l.pt",
|
|
48
|
+
"yolov8x.pt",
|
|
49
|
+
"yolov8n-seg.pt",
|
|
50
|
+
"yolov8s-seg.pt",
|
|
51
|
+
"yolov8m-seg.pt",
|
|
52
|
+
"yolov8l-seg.pt",
|
|
53
|
+
"yolov8x-seg.pt",
|
|
54
|
+
"yolov8n-pose.pt",
|
|
55
|
+
"yolov8s-pose.pt",
|
|
56
|
+
"yolov8m-pose.pt",
|
|
57
|
+
"yolov8l-pose.pt",
|
|
58
|
+
"yolov8x-pose.pt",
|
|
59
|
+
]
|
|
60
|
+
else:
|
|
61
|
+
models = [model]
|
|
62
|
+
|
|
63
|
+
splits = ["train", "val", "test"]
|
|
64
|
+
|
|
53
65
|
with st.form(key="explorer_init_form"):
|
|
54
|
-
col1, col2 = st.columns(
|
|
66
|
+
col1, col2, col3 = st.columns(3)
|
|
55
67
|
with col1:
|
|
56
|
-
st.selectbox("Select dataset", ds, key="dataset"
|
|
68
|
+
st.selectbox("Select dataset", ds, key="dataset")
|
|
57
69
|
with col2:
|
|
58
70
|
st.selectbox("Select model", models, key="model")
|
|
71
|
+
with col3:
|
|
72
|
+
st.selectbox("Select split", splits, key="split")
|
|
59
73
|
st.checkbox("Force recreate embeddings", key="force_recreate_embeddings")
|
|
60
74
|
|
|
61
75
|
st.form_submit_button("Explore", on_click=_get_explorer)
|
|
@@ -182,13 +196,13 @@ def utralytics_explorer_docs_callback():
|
|
|
182
196
|
st.link_button("Ultrlaytics Explorer API", "https://docs.ultralytics.com/datasets/explorer/")
|
|
183
197
|
|
|
184
198
|
|
|
185
|
-
def layout():
|
|
199
|
+
def layout(data=None, model=None):
|
|
186
200
|
"""Resets explorer session variables and provides documentation with a link to API docs."""
|
|
187
201
|
st.set_page_config(layout="wide", initial_sidebar_state="collapsed")
|
|
188
202
|
st.markdown("<h1 style='text-align: center;'>Ultralytics Explorer Demo</h1>", unsafe_allow_html=True)
|
|
189
203
|
|
|
190
204
|
if st.session_state.get("explorer") is None:
|
|
191
|
-
init_explorer_form()
|
|
205
|
+
init_explorer_form(data, model)
|
|
192
206
|
return
|
|
193
207
|
|
|
194
208
|
st.button(":arrow_backward: Select Dataset", on_click=reset_explorer)
|
|
@@ -264,4 +278,5 @@ def layout():
|
|
|
264
278
|
|
|
265
279
|
|
|
266
280
|
if __name__ == "__main__":
|
|
267
|
-
|
|
281
|
+
kwargs = dict(zip(sys.argv[1::2], sys.argv[2::2]))
|
|
282
|
+
layout(**kwargs)
|
ultralytics/data/loaders.py
CHANGED
|
@@ -545,7 +545,7 @@ def get_best_youtube_url(url, method="pytube"):
|
|
|
545
545
|
"""
|
|
546
546
|
if method == "pytube":
|
|
547
547
|
# Switched from pytube to pytubefix to resolve https://github.com/pytube/pytube/issues/1954
|
|
548
|
-
check_requirements("pytubefix")
|
|
548
|
+
check_requirements("pytubefix==6.3.4") # bug in 6.4.2 https://github.com/JuanBindez/pytubefix/issues/123
|
|
549
549
|
from pytubefix import YouTube
|
|
550
550
|
|
|
551
551
|
streams = YouTube(url).streams.filter(file_extension="mp4", only_video=True)
|