supervisely 6.73.410__py3-none-any.whl → 6.73.470__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 supervisely might be problematic. Click here for more details.
- supervisely/__init__.py +136 -1
- supervisely/_utils.py +81 -0
- supervisely/annotation/json_geometries_map.py +2 -0
- supervisely/annotation/label.py +80 -3
- supervisely/api/annotation_api.py +9 -9
- supervisely/api/api.py +67 -43
- supervisely/api/app_api.py +72 -5
- supervisely/api/dataset_api.py +108 -33
- supervisely/api/entity_annotation/figure_api.py +113 -49
- supervisely/api/image_api.py +82 -0
- supervisely/api/module_api.py +10 -0
- supervisely/api/nn/deploy_api.py +15 -9
- supervisely/api/nn/ecosystem_models_api.py +201 -0
- supervisely/api/nn/neural_network_api.py +12 -3
- supervisely/api/pointcloud/pointcloud_api.py +38 -0
- supervisely/api/pointcloud/pointcloud_episode_annotation_api.py +3 -0
- supervisely/api/project_api.py +213 -6
- supervisely/api/task_api.py +11 -1
- supervisely/api/video/video_annotation_api.py +4 -2
- supervisely/api/video/video_api.py +79 -1
- supervisely/api/video/video_figure_api.py +24 -11
- supervisely/api/volume/volume_api.py +38 -0
- supervisely/app/__init__.py +1 -1
- supervisely/app/content.py +14 -6
- supervisely/app/fastapi/__init__.py +1 -0
- supervisely/app/fastapi/custom_static_files.py +1 -1
- supervisely/app/fastapi/multi_user.py +88 -0
- supervisely/app/fastapi/subapp.py +175 -42
- supervisely/app/fastapi/templating.py +1 -1
- supervisely/app/fastapi/websocket.py +77 -9
- supervisely/app/singleton.py +21 -0
- supervisely/app/v1/app_service.py +18 -2
- supervisely/app/v1/constants.py +7 -1
- supervisely/app/widgets/__init__.py +11 -1
- supervisely/app/widgets/agent_selector/template.html +1 -0
- supervisely/app/widgets/card/card.py +20 -0
- supervisely/app/widgets/dataset_thumbnail/dataset_thumbnail.py +11 -2
- supervisely/app/widgets/dataset_thumbnail/template.html +3 -1
- supervisely/app/widgets/deploy_model/deploy_model.py +750 -0
- supervisely/app/widgets/dialog/dialog.py +12 -0
- supervisely/app/widgets/dialog/template.html +2 -1
- supervisely/app/widgets/dropdown_checkbox_selector/__init__.py +0 -0
- supervisely/app/widgets/dropdown_checkbox_selector/dropdown_checkbox_selector.py +87 -0
- supervisely/app/widgets/dropdown_checkbox_selector/template.html +12 -0
- supervisely/app/widgets/ecosystem_model_selector/__init__.py +0 -0
- supervisely/app/widgets/ecosystem_model_selector/ecosystem_model_selector.py +195 -0
- supervisely/app/widgets/experiment_selector/experiment_selector.py +454 -263
- supervisely/app/widgets/fast_table/fast_table.py +713 -126
- supervisely/app/widgets/fast_table/script.js +492 -95
- supervisely/app/widgets/fast_table/style.css +54 -0
- supervisely/app/widgets/fast_table/template.html +45 -5
- supervisely/app/widgets/heatmap/__init__.py +0 -0
- supervisely/app/widgets/heatmap/heatmap.py +523 -0
- supervisely/app/widgets/heatmap/script.js +378 -0
- supervisely/app/widgets/heatmap/style.css +227 -0
- supervisely/app/widgets/heatmap/template.html +21 -0
- supervisely/app/widgets/input_tag/input_tag.py +102 -15
- supervisely/app/widgets/input_tag_list/__init__.py +0 -0
- supervisely/app/widgets/input_tag_list/input_tag_list.py +274 -0
- supervisely/app/widgets/input_tag_list/template.html +70 -0
- supervisely/app/widgets/radio_table/radio_table.py +10 -2
- supervisely/app/widgets/radio_tabs/radio_tabs.py +18 -2
- supervisely/app/widgets/radio_tabs/template.html +1 -0
- supervisely/app/widgets/select/select.py +6 -4
- supervisely/app/widgets/select_dataset/select_dataset.py +6 -0
- supervisely/app/widgets/select_dataset_tree/select_dataset_tree.py +83 -7
- supervisely/app/widgets/table/table.py +68 -13
- supervisely/app/widgets/tabs/tabs.py +22 -6
- supervisely/app/widgets/tabs/template.html +5 -1
- supervisely/app/widgets/transfer/style.css +3 -0
- supervisely/app/widgets/transfer/template.html +3 -1
- supervisely/app/widgets/transfer/transfer.py +48 -45
- supervisely/app/widgets/tree_select/tree_select.py +2 -0
- supervisely/convert/image/csv/csv_converter.py +24 -15
- supervisely/convert/pointcloud/nuscenes_conv/nuscenes_converter.py +43 -41
- supervisely/convert/pointcloud_episodes/nuscenes_conv/nuscenes_converter.py +75 -51
- supervisely/convert/pointcloud_episodes/nuscenes_conv/nuscenes_helper.py +137 -124
- supervisely/convert/video/video_converter.py +2 -2
- supervisely/geometry/polyline_3d.py +110 -0
- supervisely/io/env.py +161 -1
- supervisely/nn/artifacts/__init__.py +1 -1
- supervisely/nn/artifacts/artifacts.py +10 -2
- supervisely/nn/artifacts/detectron2.py +1 -0
- supervisely/nn/artifacts/hrda.py +1 -0
- supervisely/nn/artifacts/mmclassification.py +20 -0
- supervisely/nn/artifacts/mmdetection.py +5 -3
- supervisely/nn/artifacts/mmsegmentation.py +1 -0
- supervisely/nn/artifacts/ritm.py +1 -0
- supervisely/nn/artifacts/rtdetr.py +1 -0
- supervisely/nn/artifacts/unet.py +1 -0
- supervisely/nn/artifacts/utils.py +3 -0
- supervisely/nn/artifacts/yolov5.py +2 -0
- supervisely/nn/artifacts/yolov8.py +1 -0
- supervisely/nn/benchmark/semantic_segmentation/metric_provider.py +18 -18
- supervisely/nn/experiments.py +9 -0
- supervisely/nn/inference/cache.py +37 -17
- supervisely/nn/inference/gui/serving_gui_template.py +39 -13
- supervisely/nn/inference/inference.py +953 -211
- supervisely/nn/inference/inference_request.py +15 -8
- supervisely/nn/inference/instance_segmentation/instance_segmentation.py +1 -0
- supervisely/nn/inference/object_detection/object_detection.py +1 -0
- supervisely/nn/inference/predict_app/__init__.py +0 -0
- supervisely/nn/inference/predict_app/gui/__init__.py +0 -0
- supervisely/nn/inference/predict_app/gui/classes_selector.py +160 -0
- supervisely/nn/inference/predict_app/gui/gui.py +915 -0
- supervisely/nn/inference/predict_app/gui/input_selector.py +344 -0
- supervisely/nn/inference/predict_app/gui/model_selector.py +77 -0
- supervisely/nn/inference/predict_app/gui/output_selector.py +179 -0
- supervisely/nn/inference/predict_app/gui/preview.py +93 -0
- supervisely/nn/inference/predict_app/gui/settings_selector.py +881 -0
- supervisely/nn/inference/predict_app/gui/tags_selector.py +110 -0
- supervisely/nn/inference/predict_app/gui/utils.py +399 -0
- supervisely/nn/inference/predict_app/predict_app.py +176 -0
- supervisely/nn/inference/session.py +47 -39
- supervisely/nn/inference/tracking/bbox_tracking.py +5 -1
- supervisely/nn/inference/tracking/point_tracking.py +5 -1
- supervisely/nn/inference/tracking/tracker_interface.py +4 -0
- supervisely/nn/inference/uploader.py +9 -5
- supervisely/nn/model/model_api.py +44 -22
- supervisely/nn/model/prediction.py +15 -1
- supervisely/nn/model/prediction_session.py +70 -14
- supervisely/nn/prediction_dto.py +7 -0
- supervisely/nn/tracker/__init__.py +6 -8
- supervisely/nn/tracker/base_tracker.py +54 -0
- supervisely/nn/tracker/botsort/__init__.py +1 -0
- supervisely/nn/tracker/botsort/botsort_config.yaml +30 -0
- supervisely/nn/tracker/botsort/osnet_reid/__init__.py +0 -0
- supervisely/nn/tracker/botsort/osnet_reid/osnet.py +566 -0
- supervisely/nn/tracker/botsort/osnet_reid/osnet_reid_interface.py +88 -0
- supervisely/nn/tracker/botsort/tracker/__init__.py +0 -0
- supervisely/nn/tracker/{bot_sort → botsort/tracker}/basetrack.py +1 -2
- supervisely/nn/tracker/{utils → botsort/tracker}/gmc.py +51 -59
- supervisely/nn/tracker/{deep_sort/deep_sort → botsort/tracker}/kalman_filter.py +71 -33
- supervisely/nn/tracker/botsort/tracker/matching.py +202 -0
- supervisely/nn/tracker/{bot_sort/bot_sort.py → botsort/tracker/mc_bot_sort.py} +68 -81
- supervisely/nn/tracker/botsort_tracker.py +273 -0
- supervisely/nn/tracker/calculate_metrics.py +264 -0
- supervisely/nn/tracker/utils.py +273 -0
- supervisely/nn/tracker/visualize.py +520 -0
- supervisely/nn/training/gui/gui.py +152 -49
- supervisely/nn/training/gui/hyperparameters_selector.py +1 -1
- supervisely/nn/training/gui/model_selector.py +8 -6
- supervisely/nn/training/gui/train_val_splits_selector.py +144 -71
- supervisely/nn/training/gui/training_artifacts.py +3 -1
- supervisely/nn/training/train_app.py +225 -46
- supervisely/project/pointcloud_episode_project.py +12 -8
- supervisely/project/pointcloud_project.py +12 -8
- supervisely/project/project.py +221 -75
- supervisely/template/experiment/experiment.html.jinja +105 -55
- supervisely/template/experiment/experiment_generator.py +258 -112
- supervisely/template/experiment/header.html.jinja +31 -13
- supervisely/template/experiment/sly-style.css +7 -2
- supervisely/versions.json +3 -1
- supervisely/video/sampling.py +42 -20
- supervisely/video/video.py +41 -12
- supervisely/video_annotation/video_figure.py +38 -4
- supervisely/volume/stl_converter.py +2 -0
- supervisely/worker_api/agent_rpc.py +24 -1
- supervisely/worker_api/rpc_servicer.py +31 -7
- {supervisely-6.73.410.dist-info → supervisely-6.73.470.dist-info}/METADATA +22 -14
- {supervisely-6.73.410.dist-info → supervisely-6.73.470.dist-info}/RECORD +167 -148
- supervisely_lib/__init__.py +6 -1
- supervisely/app/widgets/experiment_selector/style.css +0 -27
- supervisely/app/widgets/experiment_selector/template.html +0 -61
- supervisely/nn/tracker/bot_sort/__init__.py +0 -21
- supervisely/nn/tracker/bot_sort/fast_reid_interface.py +0 -152
- supervisely/nn/tracker/bot_sort/matching.py +0 -127
- supervisely/nn/tracker/bot_sort/sly_tracker.py +0 -401
- supervisely/nn/tracker/deep_sort/__init__.py +0 -6
- supervisely/nn/tracker/deep_sort/deep_sort/__init__.py +0 -1
- supervisely/nn/tracker/deep_sort/deep_sort/detection.py +0 -49
- supervisely/nn/tracker/deep_sort/deep_sort/iou_matching.py +0 -81
- supervisely/nn/tracker/deep_sort/deep_sort/linear_assignment.py +0 -202
- supervisely/nn/tracker/deep_sort/deep_sort/nn_matching.py +0 -176
- supervisely/nn/tracker/deep_sort/deep_sort/track.py +0 -166
- supervisely/nn/tracker/deep_sort/deep_sort/tracker.py +0 -145
- supervisely/nn/tracker/deep_sort/deep_sort.py +0 -301
- supervisely/nn/tracker/deep_sort/generate_clip_detections.py +0 -90
- supervisely/nn/tracker/deep_sort/preprocessing.py +0 -70
- supervisely/nn/tracker/deep_sort/sly_tracker.py +0 -273
- supervisely/nn/tracker/tracker.py +0 -285
- supervisely/nn/tracker/utils/kalman_filter.py +0 -492
- supervisely/nn/tracking/__init__.py +0 -1
- supervisely/nn/tracking/boxmot.py +0 -114
- supervisely/nn/tracking/tracking.py +0 -24
- /supervisely/{nn/tracker/utils → app/widgets/deploy_model}/__init__.py +0 -0
- {supervisely-6.73.410.dist-info → supervisely-6.73.470.dist-info}/LICENSE +0 -0
- {supervisely-6.73.410.dist-info → supervisely-6.73.470.dist-info}/WHEEL +0 -0
- {supervisely-6.73.410.dist-info → supervisely-6.73.470.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.410.dist-info → supervisely-6.73.470.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ Here are prediction samples made with **{{ experiment.training.checkpoints.pytor
|
|
|
14
14
|
|
|
15
15
|
## Evaluation
|
|
16
16
|
|
|
17
|
-
The **{{ experiment.training.checkpoints.pytorch.name }}** checkpoint was evaluated on the validation set containing **{{ experiment.project.splits.val }}
|
|
17
|
+
The **{{ experiment.training.checkpoints.pytorch.name }}** checkpoint was evaluated on the validation set containing **{{ experiment.project.splits.val.size }}
|
|
18
18
|
images**.
|
|
19
19
|
|
|
20
20
|
See the full [📊 Evaluation Report]({{ experiment.training.evaluation.url }}) for details and visualizations.
|
|
@@ -28,6 +28,35 @@ was performed.
|
|
|
28
28
|
|
|
29
29
|
{% endif %}
|
|
30
30
|
|
|
31
|
+
{% if widgets.training_plots %}
|
|
32
|
+
|
|
33
|
+
## Training Plots
|
|
34
|
+
|
|
35
|
+
Visualization of the training scalars logged during the experiment.
|
|
36
|
+
|
|
37
|
+
{% if experiment.training.logs.path %}
|
|
38
|
+
<div>
|
|
39
|
+
<sly-iw-launch-button
|
|
40
|
+
class="training-plots-button"
|
|
41
|
+
style=""
|
|
42
|
+
:disabled="false"
|
|
43
|
+
:autoRun="true"
|
|
44
|
+
:state="{ 'slyFolder': '{{ experiment.training.logs.path }}' }"
|
|
45
|
+
:moduleId="{{ resources.apps.log_viewer.module_id }}"
|
|
46
|
+
:proxyKeepUrl="true"
|
|
47
|
+
:openInNewWindow="true"
|
|
48
|
+
:command="command">
|
|
49
|
+
<span>Open Logs</span> <i class="zmdi zmdi-arrow-right-top" />
|
|
50
|
+
</sly-iw-launch-button>
|
|
51
|
+
</div>
|
|
52
|
+
{% endif %}
|
|
53
|
+
|
|
54
|
+
<div class="training-plots">
|
|
55
|
+
{{ widgets.training_plots | safe }}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
{% endif %}
|
|
59
|
+
|
|
31
60
|
## Artifacts
|
|
32
61
|
|
|
33
62
|
[📂 Open in Team Files]({{ experiment.paths.artifacts_dir.url }}){:target="_blank"}
|
|
@@ -89,10 +118,8 @@ The quick actions on this page, such as **Deploy**, **Predict**, or **Fine-tune*
|
|
|
89
118
|
}}){:target="_blank"} - deploy your model in the Supervisely Platform.
|
|
90
119
|
- [Train {{ experiment.model.framework }}]({{ env.server_address }}/ecosystem/apps/{{ resources.apps.train.slug
|
|
91
120
|
}}){:target="_blank"} - train a model in the Supervisely Platform.
|
|
92
|
-
- [
|
|
93
|
-
|
|
94
|
-
- [Apply NN to Videos]({{ env.server_address }}/ecosystem/apps/{{ resources.apps.apply_nn_to_videos.slug }}){:target="_blank"} -
|
|
95
|
-
for predictions on video project or dataset.
|
|
121
|
+
- [Predict App]({{ env.server_address }}/ecosystem/apps/{{ resources.apps.predict.slug }}){:target="_blank"} -
|
|
122
|
+
deploy your model and make predictions.
|
|
96
123
|
|
|
97
124
|
## API Integration & Deployment
|
|
98
125
|
|
|
@@ -100,10 +127,20 @@ In this section, you'll find the quickstart guides for integrating your model in
|
|
|
100
127
|
|
|
101
128
|
### Table of contents:
|
|
102
129
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
130
|
+
<ul>
|
|
131
|
+
<li>
|
|
132
|
+
<a :href="`${location.pathname}#supervisely-api`">Supervisely API</a>
|
|
133
|
+
</li>
|
|
134
|
+
<li>
|
|
135
|
+
<a :href="`${location.pathname}#deploy-in-docker`">Deploy in Docker</a>
|
|
136
|
+
</li>
|
|
137
|
+
<li>
|
|
138
|
+
<a :href="`${location.pathname}#deploy-locally-with-supervisely-sdk`">Deploy locally with Supervisely SDK</a>
|
|
139
|
+
</li>
|
|
140
|
+
<li>
|
|
141
|
+
<a :href="`${location.pathname}#using-original-model-codebase`">Using Original Model Codebase API</a>
|
|
142
|
+
</li>
|
|
143
|
+
</ul>
|
|
107
144
|
|
|
108
145
|
## Supervisely API
|
|
109
146
|
|
|
@@ -137,6 +174,7 @@ can pass them in the terminal before running the script:
|
|
|
137
174
|
model = api.nn.deploy(
|
|
138
175
|
model="{{ experiment.paths.artifacts_dir.path }}/checkpoints/{{ experiment.training.checkpoints.pytorch.name }}",
|
|
139
176
|
device="cuda:0", # or "cpu"
|
|
177
|
+
workspace_id={{ experiment.project.workspace_id }}
|
|
140
178
|
)
|
|
141
179
|
|
|
142
180
|
# 3. Predict
|
|
@@ -163,6 +201,7 @@ api = sly.Api()
|
|
|
163
201
|
model = api.nn.deploy(
|
|
164
202
|
model="{{ experiment.paths.artifacts_dir.path }}/checkpoints/{{ experiment.training.checkpoints.pytorch.name }}",
|
|
165
203
|
device="cuda:0", # or "cpu"
|
|
204
|
+
workspace_id={{ experiment.project.workspace_id }}
|
|
166
205
|
)
|
|
167
206
|
```
|
|
168
207
|
|
|
@@ -180,6 +219,7 @@ api = sly.Api()
|
|
|
180
219
|
model = api.nn.deploy(
|
|
181
220
|
model="{{ experiment.paths.artifacts_dir.path }}/export/{{ experiment.training.checkpoints.onnx.name }}",
|
|
182
221
|
device="cuda:0", # or "cpu"
|
|
222
|
+
workspace_id={{ experiment.project.workspace_id }}
|
|
183
223
|
)
|
|
184
224
|
```
|
|
185
225
|
|
|
@@ -198,6 +238,7 @@ api = sly.Api()
|
|
|
198
238
|
model = api.nn.deploy(
|
|
199
239
|
model="{{ experiment.paths.artifacts_dir.path }}/export/{{ experiment.training.checkpoints.tensorrt.name }}",
|
|
200
240
|
device="cuda:0", # or "cpu"
|
|
241
|
+
workspace_id={{ experiment.project.workspace_id }}
|
|
201
242
|
)
|
|
202
243
|
```
|
|
203
244
|
|
|
@@ -207,7 +248,7 @@ model = api.nn.deploy(
|
|
|
207
248
|
{% endtabs %}
|
|
208
249
|
|
|
209
250
|
> For more information, see [Model
|
|
210
|
-
API](https://docs.supervisely.com/neural-networks/
|
|
251
|
+
API](https://docs.supervisely.com/neural-networks/inference-and-deployment/model-api){:target="_blank"}
|
|
211
252
|
documentation.
|
|
212
253
|
|
|
213
254
|
### Predict via API
|
|
@@ -232,7 +273,9 @@ predictions = model.predict(
|
|
|
232
273
|
|
|
233
274
|
```python
|
|
234
275
|
# Predict images in Supervisely
|
|
235
|
-
predictions = model.predict(
|
|
276
|
+
predictions = model.predict(
|
|
277
|
+
image_ids=[123, 124] # Image IDs in Supervisely
|
|
278
|
+
)
|
|
236
279
|
```
|
|
237
280
|
|
|
238
281
|
{% endtab %}
|
|
@@ -241,7 +284,9 @@ predictions = model.predict(image_ids=[123, 124] # Image IDs in Supervisely)
|
|
|
241
284
|
|
|
242
285
|
```python
|
|
243
286
|
# Predict dataset
|
|
244
|
-
predictions = model.predict(
|
|
287
|
+
predictions = model.predict(
|
|
288
|
+
dataset_id=12 # Dataset ID in Supervisely
|
|
289
|
+
)
|
|
245
290
|
```
|
|
246
291
|
|
|
247
292
|
{% endtab %}
|
|
@@ -250,7 +295,9 @@ predictions = model.predict(dataset_id=12 # Dataset ID in Supervisely)
|
|
|
250
295
|
|
|
251
296
|
```python
|
|
252
297
|
# Predict project
|
|
253
|
-
predictions = model.predict(
|
|
298
|
+
predictions = model.predict(
|
|
299
|
+
project_id=21 # Project ID in Supervisely
|
|
300
|
+
)
|
|
254
301
|
```
|
|
255
302
|
|
|
256
303
|
{% endtab %}
|
|
@@ -259,7 +306,9 @@ predictions = model.predict(project_id=21 # Project ID in Supervisely)
|
|
|
259
306
|
|
|
260
307
|
```python
|
|
261
308
|
# Predict video
|
|
262
|
-
predictions = model.predict(
|
|
309
|
+
predictions = model.predict(
|
|
310
|
+
video_id=123 # Video ID in Supervisely
|
|
311
|
+
)
|
|
263
312
|
```
|
|
264
313
|
|
|
265
314
|
{% endtab %}
|
|
@@ -267,55 +316,47 @@ predictions = model.predict(video_id=123 # Video ID in Supervisely)
|
|
|
267
316
|
{% endtabs %}
|
|
268
317
|
|
|
269
318
|
> For more information, see [Prediction
|
|
270
|
-
API](https://docs.supervisely.com/neural-networks/
|
|
319
|
+
API](https://docs.supervisely.com/neural-networks/inference-and-deployment/prediction-api){:target="_blank"}.
|
|
271
320
|
|
|
272
321
|
{% if experiment.model.task_type == "object detection" %}
|
|
273
322
|
|
|
274
323
|
## Tracking Objects in Video
|
|
275
324
|
|
|
276
|
-
|
|
277
|
-
[BoxMot](https://github.com/mikel-brostrom/boxmot){:target="_blank"} is a
|
|
278
|
-
third-party library that implements lightweight neural networks for tracking-by-detection task (when the tracking is
|
|
279
|
-
performed on the objects predicted by a separate detector). For `boxmot` models you can use even CPU device.
|
|
280
|
-
|
|
281
|
-
First, install [BoxMot](https://github.com/mikel-brostrom/boxmot){:target="_blank"}:
|
|
325
|
+
Supervisely now supports **tracking-by-detection** out of the box. We leverage a lightweight tracking algorithm (such as [BoT-SORT](https://github.com/NirAharon/BoT-SORT){:target="_blank"}) which identifies the unique objects across video frames and assigns IDs to them. This allows us to connect separate detections from different frames into a single track for each object.
|
|
282
326
|
|
|
283
|
-
|
|
284
|
-
pip install boxmot
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Supervisely SDK has the `track()` method from `supervisely.nn.tracking` which allows you to apply `boxmot` models
|
|
288
|
-
together with a detector in a single line of code. This method takes two arguments: a `boxmot` tracker, and a
|
|
289
|
-
`PredictionSession` of a detector. It returns a `sly.VideoAnnotation` with the tracked objects.
|
|
327
|
+
To apply tracking via API, first, deploy your detection model or connect to it, and then use the `predict()` method with `tracking=True` parameter. You can also specify tracking configuration parameters by passing `tracking_config={...}` with your custom settings.
|
|
290
328
|
|
|
291
329
|
```python
|
|
292
330
|
import supervisely as sly
|
|
293
|
-
from supervisely.nn.tracking import track
|
|
294
|
-
import boxmot
|
|
295
|
-
from pathlib import Path
|
|
296
|
-
|
|
297
|
-
# Deploy a detector
|
|
298
|
-
detector = api.nn.deploy(
|
|
299
|
-
model="{{ experiment.model.framework }}/{{ experiment.model.name }}",
|
|
300
|
-
device="cuda:0", # Use GPU for detection
|
|
301
|
-
)
|
|
302
331
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
332
|
+
api = sly.Api()
|
|
333
|
+
|
|
334
|
+
# Deploy your model
|
|
335
|
+
model = api.nn.deploy(
|
|
336
|
+
model="{{ experiment.paths.artifacts_dir.path }}/checkpoints/{{ experiment.training.checkpoints.pytorch.name }}",
|
|
337
|
+
device="cuda",
|
|
338
|
+
workspace_id={{ experiment.project.workspace_id }},
|
|
307
339
|
)
|
|
308
340
|
|
|
309
|
-
#
|
|
310
|
-
|
|
311
|
-
video_id=
|
|
312
|
-
|
|
313
|
-
|
|
341
|
+
# Apply tracking
|
|
342
|
+
predictions = model.predict(
|
|
343
|
+
video_id=YOUR_VIDEO_ID, # Video ID in Supervisely
|
|
344
|
+
tracking=True,
|
|
345
|
+
tracking_config={
|
|
346
|
+
"tracker": "botsort", # botsort is a powerful tracking algorithm used by default
|
|
347
|
+
# You can pass other tracking parameters here, see the docs for details
|
|
348
|
+
}
|
|
314
349
|
)
|
|
350
|
+
|
|
351
|
+
# Processing results
|
|
352
|
+
for pred in predictions:
|
|
353
|
+
frame_index = pred.frame_index
|
|
354
|
+
annotation = pred.annotation
|
|
355
|
+
track_ids = pred.track_ids
|
|
356
|
+
print(f"Frame {frame_index}: {len(track_ids)} tracks")
|
|
315
357
|
```
|
|
316
358
|
|
|
317
|
-
>
|
|
318
|
-
Video](https://docs.supervisely.com/neural-networks/overview-1/prediction-api#tracking-objects-in-video){:target="_blank"}.
|
|
359
|
+
> You can also apply trackers in your own code or applications. Read more about this in the docs [Video Object Tracking](https://docs.supervisely.com/neural-networks/inference-and-deployment/video-object-tracking){:target="_blank"}.
|
|
319
360
|
|
|
320
361
|
{% endif %}
|
|
321
362
|
|
|
@@ -324,9 +365,9 @@ Video](https://docs.supervisely.com/neural-networks/overview-1/prediction-api#tr
|
|
|
324
365
|
You can deploy the model in a 🐋 Docker Container with a single `docker run` command. Download a checkpoint, pull the
|
|
325
366
|
docker image for the corresponding model's framework, and run the `docker run` command with addtional arguments.
|
|
326
367
|
|
|
327
|
-
1. Download
|
|
368
|
+
1. Download training artifacts from Supervisely ([Open in Team Files]({{ experiment.paths.artifacts_dir.url }}){:target="_blank"})
|
|
328
369
|
|
|
329
|
-
2. Pull the Docker image
|
|
370
|
+
2. Pull the Docker image for deployment
|
|
330
371
|
|
|
331
372
|
```bash
|
|
332
373
|
docker pull {{ code.docker.deploy }}
|
|
@@ -361,7 +402,7 @@ docker image for the corresponding model's framework, and run the `docker run` c
|
|
|
361
402
|
)
|
|
362
403
|
```
|
|
363
404
|
|
|
364
|
-
See the [Model API](https://docs.supervisely.com/neural-networks/
|
|
405
|
+
See the [Model API](https://docs.supervisely.com/neural-networks/inference-and-deployment/model-api){:target="_blank"} documentation for more details on how to use the `ModelAPI` class.
|
|
365
406
|
|
|
366
407
|
Alternatively, you can use `docker run` with the `predict` action to make predictions in a single command. This is a
|
|
367
408
|
quick way to start inference on your local images, videos, or directories without deploying the model. The container will be automatically stopped after the predictions are made.
|
|
@@ -379,7 +420,7 @@ docker run \
|
|
|
379
420
|
```
|
|
380
421
|
|
|
381
422
|
> For more information, see [Deploy in Docker
|
|
382
|
-
Container](https://docs.supervisely.com/neural-networks/
|
|
423
|
+
Container](https://docs.supervisely.com/neural-networks/inference-and-deployment/deploy_and_predict_with_supervisely_sdk#deploy-in-docker-container){:target="_blank"}
|
|
383
424
|
documentation.
|
|
384
425
|
|
|
385
426
|
## Deploy locally with Supervisely SDK
|
|
@@ -424,7 +465,7 @@ This approach helps you to quickly set up the environment and run inference with
|
|
|
424
465
|
)
|
|
425
466
|
```
|
|
426
467
|
|
|
427
|
-
> For more information, see [Local Deployment](https://docs.supervisely.com/neural-networks/
|
|
468
|
+
> For more information, see [Local Deployment](https://docs.supervisely.com/neural-networks/inference-and-deployment/deploy_and_predict_with_supervisely_sdk){:target="_blank"} and [Prediction API](https://docs.supervisely.com/neural-networks/inference-and-deployment/prediction-api){:target="_blank"} documentations.
|
|
428
469
|
|
|
429
470
|
{% if experiment.training.checkpoints.onnx.name or experiment.training.checkpoints.tensorrt.name %}
|
|
430
471
|
### Deploy ONNX/TensorRT
|
|
@@ -484,11 +525,20 @@ using the original code from the authors.
|
|
|
484
525
|
|
|
485
526
|
1. Download checkpoint from Supervisely ([Open in Team Files]({{ experiment.paths.checkpoints_dir.url }}){:target="_blank"})
|
|
486
527
|
|
|
487
|
-
|
|
488
|
-
|
|
528
|
+
{% if resources.original_repository.name and resources.original_repository.url %}
|
|
529
|
+
|
|
530
|
+
2. Prepare environment following the instructions of the original repository [{{ resources.original_repository.name }}]({{
|
|
531
|
+
resources.original_repository.url }}){:target="_blank"}
|
|
532
|
+
|
|
533
|
+
3. Use the demo script for inference:
|
|
534
|
+
|
|
535
|
+
{% else %}
|
|
536
|
+
2. Prepare environment following the instructions of the original repository
|
|
489
537
|
|
|
490
538
|
3. Use the demo script for inference:
|
|
491
539
|
|
|
540
|
+
{% endif %}
|
|
541
|
+
|
|
492
542
|
<details>
|
|
493
543
|
<summary><strong>🐍 View Code</strong></summary>
|
|
494
544
|
|