ultralytics 8.2.54__py3-none-any.whl → 8.2.56__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/engine/exporter.py +4 -4
- ultralytics/hub/utils.py +1 -1
- ultralytics/solutions/streamlit_inference.py +15 -25
- ultralytics/utils/torch_utils.py +4 -1
- {ultralytics-8.2.54.dist-info → ultralytics-8.2.56.dist-info}/METADATA +1 -1
- {ultralytics-8.2.54.dist-info → ultralytics-8.2.56.dist-info}/RECORD +11 -11
- {ultralytics-8.2.54.dist-info → ultralytics-8.2.56.dist-info}/LICENSE +0 -0
- {ultralytics-8.2.54.dist-info → ultralytics-8.2.56.dist-info}/WHEEL +0 -0
- {ultralytics-8.2.54.dist-info → ultralytics-8.2.56.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.2.54.dist-info → ultralytics-8.2.56.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/engine/exporter.py
CHANGED
|
@@ -1017,13 +1017,13 @@ class Exporter:
|
|
|
1017
1017
|
"""Add metadata to *.tflite models per https://www.tensorflow.org/lite/models/convert/metadata."""
|
|
1018
1018
|
import flatbuffers
|
|
1019
1019
|
|
|
1020
|
-
|
|
1021
|
-
from tflite_support import metadata # noqa
|
|
1022
|
-
from tflite_support import metadata_schema_py_generated as schema # noqa
|
|
1023
|
-
else:
|
|
1020
|
+
try:
|
|
1024
1021
|
# TFLite Support bug https://github.com/tensorflow/tflite-support/issues/954#issuecomment-2108570845
|
|
1025
1022
|
from tensorflow_lite_support.metadata import metadata_schema_py_generated as schema # noqa
|
|
1026
1023
|
from tensorflow_lite_support.metadata.python import metadata # noqa
|
|
1024
|
+
except ImportError: # ARM64 systems may not have the 'tensorflow_lite_support' package available
|
|
1025
|
+
from tflite_support import metadata # noqa
|
|
1026
|
+
from tflite_support import metadata_schema_py_generated as schema # noqa
|
|
1027
1027
|
|
|
1028
1028
|
# Create model info
|
|
1029
1029
|
model_meta = schema.ModelMetadataT()
|
ultralytics/hub/utils.py
CHANGED
|
@@ -185,7 +185,7 @@ class Events:
|
|
|
185
185
|
def __init__(self):
|
|
186
186
|
"""Initializes the Events object with default values for events, rate_limit, and metadata."""
|
|
187
187
|
self.events = [] # events list
|
|
188
|
-
self.rate_limit =
|
|
188
|
+
self.rate_limit = 30.0 # rate limit (seconds)
|
|
189
189
|
self.t = 0.0 # rate limit timer (seconds)
|
|
190
190
|
self.metadata = {
|
|
191
191
|
"cli": Path(ARGV[0]).name == "yolo",
|
|
@@ -6,6 +6,8 @@ import time
|
|
|
6
6
|
import cv2
|
|
7
7
|
import torch
|
|
8
8
|
|
|
9
|
+
from ultralytics.utils.downloads import GITHUB_ASSETS_STEMS
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
def inference():
|
|
11
13
|
"""Runs real-time object detection on video input using Ultralytics YOLOv8 in a Streamlit application."""
|
|
@@ -65,28 +67,12 @@ def inference():
|
|
|
65
67
|
vid_file_name = 0
|
|
66
68
|
|
|
67
69
|
# Add dropdown menu for model selection
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"YOLOv8l",
|
|
75
|
-
"YOLOv8x",
|
|
76
|
-
"YOLOv8n-Seg",
|
|
77
|
-
"YOLOv8s-Seg",
|
|
78
|
-
"YOLOv8m-Seg",
|
|
79
|
-
"YOLOv8l-Seg",
|
|
80
|
-
"YOLOv8x-Seg",
|
|
81
|
-
"YOLOv8n-Pose",
|
|
82
|
-
"YOLOv8s-Pose",
|
|
83
|
-
"YOLOv8m-Pose",
|
|
84
|
-
"YOLOv8l-Pose",
|
|
85
|
-
"YOLOv8x-Pose",
|
|
86
|
-
),
|
|
87
|
-
)
|
|
88
|
-
model = YOLO(f"{yolov8_model.lower()}.pt") # Load the yolov8 model
|
|
89
|
-
class_names = list(model.names.values()) # Convert dictionary to list of class names
|
|
70
|
+
available_models = (x.replace("yolo", "YOLO") for x in GITHUB_ASSETS_STEMS if x.startswith("yolov8"))
|
|
71
|
+
selected_model = st.sidebar.selectbox("Model", available_models)
|
|
72
|
+
with st.spinner("Model is downloading..."):
|
|
73
|
+
model = YOLO(f"{selected_model.lower()}.pt") # Load the YOLO model
|
|
74
|
+
class_names = list(model.names.values()) # Convert dictionary to list of class names
|
|
75
|
+
st.success("Model loaded successfully!")
|
|
90
76
|
|
|
91
77
|
# Multiselect box with class names and get indices of selected classes
|
|
92
78
|
selected_classes = st.sidebar.multiselect("Classes", class_names, default=class_names[:3])
|
|
@@ -95,8 +81,9 @@ def inference():
|
|
|
95
81
|
if not isinstance(selected_ind, list): # Ensure selected_options is a list
|
|
96
82
|
selected_ind = list(selected_ind)
|
|
97
83
|
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
enable_trk = st.sidebar.radio("Enable Tracking", ("Yes", "No"))
|
|
85
|
+
conf = float(st.sidebar.slider("Confidence Threshold", 0.0, 1.0, 0.25, 0.01))
|
|
86
|
+
iou = float(st.sidebar.slider("IoU Threshold", 0.0, 1.0, 0.45, 0.01))
|
|
100
87
|
|
|
101
88
|
col1, col2 = st.columns(2)
|
|
102
89
|
org_frame = col1.empty()
|
|
@@ -124,7 +111,10 @@ def inference():
|
|
|
124
111
|
prev_time = curr_time
|
|
125
112
|
|
|
126
113
|
# Store model predictions
|
|
127
|
-
|
|
114
|
+
if enable_trk:
|
|
115
|
+
results = model.track(frame, conf=conf, iou=iou, classes=selected_ind, persist=True)
|
|
116
|
+
else:
|
|
117
|
+
results = model(frame, conf=conf, iou=iou, classes=selected_ind)
|
|
128
118
|
annotated_frame = results[0].plot() # Add annotations on frame
|
|
129
119
|
|
|
130
120
|
# display frame
|
ultralytics/utils/torch_utils.py
CHANGED
|
@@ -271,7 +271,7 @@ def model_info(model, detailed=False, verbose=True, imgsz=640):
|
|
|
271
271
|
fs = f", {flops:.1f} GFLOPs" if flops else ""
|
|
272
272
|
yaml_file = getattr(model, "yaml_file", "") or getattr(model, "yaml", {}).get("yaml_file", "")
|
|
273
273
|
model_name = Path(yaml_file).stem.replace("yolo", "YOLO") or "Model"
|
|
274
|
-
LOGGER.info(f"{model_name} summary{fused}: {n_l} layers, {n_p} parameters, {n_g} gradients{fs}")
|
|
274
|
+
LOGGER.info(f"{model_name} summary{fused}: {n_l:,} layers, {n_p:,} parameters, {n_g:,} gradients{fs}")
|
|
275
275
|
return n_l, n_p, n_g, flops
|
|
276
276
|
|
|
277
277
|
|
|
@@ -513,6 +513,9 @@ def strip_optimizer(f: Union[str, Path] = "best.pt", s: str = "") -> None:
|
|
|
513
513
|
for f in Path('path/to/model/checkpoints').rglob('*.pt'):
|
|
514
514
|
strip_optimizer(f)
|
|
515
515
|
```
|
|
516
|
+
|
|
517
|
+
Note:
|
|
518
|
+
Use `ultralytics.nn.torch_safe_load` for missing modules with `x = torch_safe_load(f)[0]`
|
|
516
519
|
"""
|
|
517
520
|
try:
|
|
518
521
|
x = torch.load(f, map_location=torch.device("cpu"))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.56
|
|
4
4
|
Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
|
5
5
|
Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
6
6
|
Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
@@ -7,7 +7,7 @@ tests/test_explorer.py,sha256=NcxSJeB6FxwkN09hQl7nnQL--HjfHB_WcZk0mEmBNHI,2215
|
|
|
7
7
|
tests/test_exports.py,sha256=Uezf3OatpPHlo5qoPw-2kqkZxuMCF9L4XF2riD4vmII,8225
|
|
8
8
|
tests/test_integrations.py,sha256=xglcfMPjfVh346PV8WTpk6tBxraCXEFJEQyyJMr5tyU,6064
|
|
9
9
|
tests/test_python.py,sha256=qhtSQ7NDfBChsVUxeSwfUIkoKq0S1Z-Rd9_MP023Y5k,21794
|
|
10
|
-
ultralytics/__init__.py,sha256=
|
|
10
|
+
ultralytics/__init__.py,sha256=vHGCfANVx6-O0kMZW2f7Cd3G8rscqy57ltGGnQ739zE,694
|
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
13
13
|
ultralytics/cfg/__init__.py,sha256=MqUsV-Mdk80dO64yY7JmplEO0Awb-25Lfx4YC9QYxhc,26210
|
|
@@ -97,7 +97,7 @@ ultralytics/data/explorer/utils.py,sha256=EvvukQiQUTBrsZznmMnyEX2EqTuwZo_Geyc8yf
|
|
|
97
97
|
ultralytics/data/explorer/gui/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
98
98
|
ultralytics/data/explorer/gui/dash.py,sha256=CPlFIIhf53j_YVAqealsC3AbcztdPqZxfniQcBnlKK4,10042
|
|
99
99
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
100
|
-
ultralytics/engine/exporter.py,sha256
|
|
100
|
+
ultralytics/engine/exporter.py,sha256=yV5DKjz5DZ6BrW8mOC5Nb5eDcuCc93Ft-RQwJ21xVZs,58729
|
|
101
101
|
ultralytics/engine/model.py,sha256=8qD5irabp8BF7bBZGwztCu8yAVQQp1kksYSea9EhdEo,39078
|
|
102
102
|
ultralytics/engine/predictor.py,sha256=W58kDCFH2AfoFzpGbos3k8zUEVsLunBuM8sc2B64rPY,17449
|
|
103
103
|
ultralytics/engine/results.py,sha256=5MevvBz0E-cpDf55FqweInlKdcQPb7sz0EgZSROJqw4,35817
|
|
@@ -107,7 +107,7 @@ ultralytics/engine/validator.py,sha256=Y21Uo8_Zto4qjk_YqQk6k7tyfpq_Qk9cfjeXeyDRx
|
|
|
107
107
|
ultralytics/hub/__init__.py,sha256=93bqI8x8-MfDYdKkQVduuocUiQj3WGnk1nIk0li08zA,5663
|
|
108
108
|
ultralytics/hub/auth.py,sha256=FID58NE6fh7Op_B45QOpWBw1qoBN0ponL16uvyb2dZ8,5399
|
|
109
109
|
ultralytics/hub/session.py,sha256=uXkP8AayJClLUD9TP8AlJSqxm-OmTgCmTXl1TkO6jQc,16147
|
|
110
|
-
ultralytics/hub/utils.py,sha256=
|
|
110
|
+
ultralytics/hub/utils.py,sha256=tXfM3QbXBcf4Y6StgHI1pktT4OM7Ic9eF3xiBFHGlhY,9721
|
|
111
111
|
ultralytics/models/__init__.py,sha256=TT9iLCL_n9Y80dcUq0Fo-p-GRZCSU2vrWXM3CoMwqqE,265
|
|
112
112
|
ultralytics/models/fastsam/__init__.py,sha256=0dt65jZ_5b7Q-mdXN8MSEkgnFRA0FIwlel_LS2RaOlU,254
|
|
113
113
|
ultralytics/models/fastsam/model.py,sha256=c7GGwaa9AXssJFwrcuytFHpPOlgSrS3n0utyf4JSL2o,1055
|
|
@@ -181,7 +181,7 @@ ultralytics/solutions/object_counter.py,sha256=IR2kvgjlaHuzfq55gtwBiGFJ7dS5-5OCF
|
|
|
181
181
|
ultralytics/solutions/parking_management.py,sha256=Bd7FU3WZ8mRBWq81Z5c8jH5WloF4jPKo8TycqU_AcEI,9786
|
|
182
182
|
ultralytics/solutions/queue_management.py,sha256=ECm6gLZplmE9Cm-zdOazHBBDcW-vvr8nx2M28fcPbts,6787
|
|
183
183
|
ultralytics/solutions/speed_estimation.py,sha256=kjqMSHGTHMZaNgTKNKWULxnJQNsvhq4WMUphMVlBjsc,6768
|
|
184
|
-
ultralytics/solutions/streamlit_inference.py,sha256=
|
|
184
|
+
ultralytics/solutions/streamlit_inference.py,sha256=_IB4f9qHQPB39NrHUbNNj8vhx1HF7fiecRi0wfdXzPU,5412
|
|
185
185
|
ultralytics/trackers/__init__.py,sha256=j72IgH2dZHQArMPK4YwcV5ieIw94fYvlGdQjB9cOQKw,227
|
|
186
186
|
ultralytics/trackers/basetrack.py,sha256=-vBDD-Q9lsxfTMK2w9kuqWGrYbRMmaBCCEbGGyR53gE,3675
|
|
187
187
|
ultralytics/trackers/bot_sort.py,sha256=39AvhYVbT7izF3--rX_e6Lhgb5czTA23gw6AgnNcRds,8601
|
|
@@ -206,7 +206,7 @@ ultralytics/utils/ops.py,sha256=Jlb0YBkN_SMVT2AjKPEjxgOtgnj7i7HTBh9FEwpoprU,3350
|
|
|
206
206
|
ultralytics/utils/patches.py,sha256=SgMqeMsq2K6JoBJP1NplXMl9C6rK0JeJUChjBrJOneo,2750
|
|
207
207
|
ultralytics/utils/plotting.py,sha256=icSUqsmJLpeXyVAIt8vxpbrxTe40mwiF5ay4el3IXl0,55584
|
|
208
208
|
ultralytics/utils/tal.py,sha256=xuIyryUjaaYHkHPG9GvBwh1xxN2Hq4y3hXOtuERehwY,16017
|
|
209
|
-
ultralytics/utils/torch_utils.py,sha256=
|
|
209
|
+
ultralytics/utils/torch_utils.py,sha256=EqBLg_G4x31InrTEvUvvMyxWaFaZ7UNts0tUUQsQmLY,27828
|
|
210
210
|
ultralytics/utils/triton.py,sha256=gg1finxno_tY2Ge9PMhmu7PI9wvoFZoiicdT4Bhqv3w,3936
|
|
211
211
|
ultralytics/utils/tuner.py,sha256=49KAadKZsUeCpwIm5Sn0grb0RPcMNI8vHGLwroDEJNI,6171
|
|
212
212
|
ultralytics/utils/callbacks/__init__.py,sha256=YrWqC3BVVaTLob4iCPR6I36mUxIUOpPJW7B_LjT78Qw,214
|
|
@@ -220,9 +220,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyz
|
|
|
220
220
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
|
221
221
|
ultralytics/utils/callbacks/tensorboard.py,sha256=QEgOVhUqY9akOs5TJIwz1Rvn6l32xWLpOxlwEyWF0B8,4136
|
|
222
222
|
ultralytics/utils/callbacks/wb.py,sha256=9-fjQIdLjr3b73DTE3rHO171KvbH1VweJ-bmbv-rqTw,6747
|
|
223
|
-
ultralytics-8.2.
|
|
224
|
-
ultralytics-8.2.
|
|
225
|
-
ultralytics-8.2.
|
|
226
|
-
ultralytics-8.2.
|
|
227
|
-
ultralytics-8.2.
|
|
228
|
-
ultralytics-8.2.
|
|
223
|
+
ultralytics-8.2.56.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
224
|
+
ultralytics-8.2.56.dist-info/METADATA,sha256=Zx1owi5MQKMjgragH3MIvG0YK1-81WKa1vh6DuMRGo8,41217
|
|
225
|
+
ultralytics-8.2.56.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
|
226
|
+
ultralytics-8.2.56.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
227
|
+
ultralytics-8.2.56.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
228
|
+
ultralytics-8.2.56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|