Skip to content

Commit dcccc44

Browse files
authored
Fixing coco keypoints export with absent points (#9565)
1 parent 83f15be commit dcccc44

File tree

8 files changed

+47
-41
lines changed

8 files changed

+47
-41
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Fixed
2+
3+
- Fixing COCO keypoints export for case when some keypoints are absent
4+
(<https://github.com/cvat-ai/cvat/pull/9565>)

cvat/apps/dataset_manager/task.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ def create_tracks(tracks, parent_track=None):
259259

260260
self._sync_frames(tracks, parent_track)
261261

262+
tracks = [track for track in tracks if track["shapes"]]
263+
262264
for track in tracks:
263265
track_attributes = track.pop("attributes", [])
264266
shapes = track.pop("shapes")
@@ -731,6 +733,8 @@ def _init_tracks_from_db(self):
731733
tracks = {}
732734
elements = {}
733735
for db_track in db_tracks:
736+
if not db_track["shapes"]:
737+
continue
734738
db_track["shapes"] = merge_table_rows(
735739
db_track["shapes"],
736740
{

cvat/requirements/base.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ av==9.2.0
1111
azure-storage-blob==12.13.0
1212
boto3~=1.37
1313
clickhouse-connect==0.6.8
14-
datumaro @ git+https://github.com/cvat-ai/datumaro.git@bdf703d0f6eac472aa94da18b8feca9678671151
14+
datumaro @ git+https://github.com/cvat-ai/datumaro.git@61e8a29fc8af5bb9c12d2712cce6be6e48eee83a
1515
dj-pagination==2.5.0
1616
# Despite direct indication allauth in requirements we should keep 'with_social' for dj-rest-auth
1717
# to avoid possible further versions conflicts (we use registration functionality)

cvat/requirements/base.txt

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SHA1:2420e62fe29e6854892ae81ad27c6d909485a979
1+
# SHA1:32a9f11e8eb690acd2fdd851d1a40ca1c32f2ef1
22
#
33
# This file is automatically generated.
44
# To update it, refer to cvat/requirements/README.txt.
@@ -19,15 +19,15 @@ azure-core==1.34.0
1919
# msrest
2020
azure-storage-blob==12.13.0
2121
# via -r cvat/requirements/base.in
22-
boto3==1.38.23
22+
boto3==1.38.42
2323
# via -r cvat/requirements/base.in
24-
botocore==1.38.23
24+
botocore==1.38.42
2525
# via
2626
# boto3
2727
# s3transfer
2828
cachetools==5.5.2
2929
# via google-auth
30-
certifi==2025.4.26
30+
certifi==2025.6.15
3131
# via
3232
# clickhouse-connect
3333
# msrest
@@ -46,14 +46,14 @@ contourpy==1.2.1
4646
# via matplotlib
4747
crontab==1.0.4
4848
# via rq-scheduler
49-
cryptography==45.0.3
49+
cryptography==45.0.4
5050
# via
5151
# azure-storage-blob
5252
# datumaro
5353
# pyjwt
5454
cycler==0.12.1
5555
# via matplotlib
56-
datumaro @ git+https://github.com/cvat-ai/datumaro.git@bdf703d0f6eac472aa94da18b8feca9678671151
56+
datumaro @ git+https://github.com/cvat-ai/datumaro.git@61e8a29fc8af5bb9c12d2712cce6be6e48eee83a
5757
# via -r cvat/requirements/base.in
5858
defusedxml==0.7.1
5959
# via
@@ -65,7 +65,7 @@ dj-pagination==2.5.0
6565
# via -r cvat/requirements/base.in
6666
dj-rest-auth[with-social]==5.0.2
6767
# via -r cvat/requirements/base.in
68-
django==4.2.21
68+
django==4.2.23
6969
# via
7070
# -r cvat/requirements/base.in
7171
# dj-rest-auth
@@ -96,7 +96,7 @@ django-crum==0.7.9
9696
# via -r cvat/requirements/base.in
9797
django-filter==2.4.0
9898
# via -r cvat/requirements/base.in
99-
django-health-check==3.18.3
99+
django-health-check==3.20.0
100100
# via -r cvat/requirements/base.in
101101
django-rq==2.8.1
102102
# via -r cvat/requirements/base.in
@@ -113,17 +113,17 @@ easyprocess==1.1
113113
# via pyunpack
114114
entrypoint2==1.1
115115
# via pyunpack
116-
fonttools==4.58.0
116+
fonttools==4.58.4
117117
# via matplotlib
118118
freezegun==1.5.2
119119
# via rq-scheduler
120120
furl==2.1.0
121121
# via -r cvat/requirements/base.in
122-
google-api-core==2.25.0rc1
122+
google-api-core==2.25.1
123123
# via
124124
# google-cloud-core
125125
# google-cloud-storage
126-
google-auth==2.40.2
126+
google-auth==2.40.3
127127
# via
128128
# google-api-core
129129
# google-cloud-core
@@ -138,7 +138,7 @@ google-resumable-media==2.7.2
138138
# via google-cloud-storage
139139
googleapis-common-protos==1.70.0
140140
# via google-api-core
141-
h5py==3.13.0
141+
h5py==3.14.0
142142
# via datumaro
143143
idna==3.10
144144
# via requests
@@ -170,7 +170,7 @@ jsonschema==4.17.3
170170
# via drf-spectacular
171171
kiwisolver==1.4.8
172172
# via matplotlib
173-
limits==5.2.0
173+
limits==5.4.0
174174
# via python-logstash-async
175175
lxml==5.4.0
176176
# via
@@ -181,9 +181,7 @@ lxml==5.4.0
181181
lz4==4.4.4
182182
# via clickhouse-connect
183183
matplotlib==3.8.4
184-
# via
185-
# datumaro
186-
# pycocotools
184+
# via datumaro
187185
mmh3==5.1.0
188186
# via pottery
189187
msrest==0.7.1
@@ -194,7 +192,7 @@ nibabel==5.3.2
194192
# via datumaro
195193
nltk==3.9.1
196194
# via datumaro
197-
oauthlib==3.2.2
195+
oauthlib==3.3.1
198196
# via requests-oauthlib
199197
orderedmultidict==1.0.1
200198
# via furl
@@ -206,19 +204,19 @@ packaging==25.0
206204
# matplotlib
207205
# nibabel
208206
# tensorboardx
209-
pandas==2.2.3
207+
pandas==2.3.0
210208
# via datumaro
211209
patool==1.12
212210
# via -r cvat/requirements/base.in
213211
pdf2image==1.14.0
214212
# via -r cvat/requirements/base.in
215-
portalocker==3.1.1
213+
portalocker==3.2.0
216214
# via datumaro
217215
pottery==3.0.1
218216
# via -r cvat/requirements/base.in
219217
proto-plus==1.26.1
220218
# via google-api-core
221-
protobuf==6.31.0
219+
protobuf==6.31.1
222220
# via
223221
# datumaro
224222
# google-api-core
@@ -240,7 +238,7 @@ pyasn1-modules==0.4.2
240238
# via
241239
# google-auth
242240
# python-ldap
243-
pycocotools==2.0.8
241+
pycocotools==2.0.10
244242
# via datumaro
245243
pycparser==2.22
246244
# via cffi
@@ -295,7 +293,7 @@ redis==4.6.0
295293
# rq
296294
regex==2024.11.6
297295
# via nltk
298-
requests==2.32.3
296+
requests==2.32.4
299297
# via
300298
# -r cvat/requirements/base.in
301299
# azure-core
@@ -321,15 +319,15 @@ rq-scheduler==0.13.1
321319
# via -r cvat/requirements/base.in
322320
rsa==4.9.1
323321
# via google-auth
324-
ruamel-yaml==0.18.11
322+
ruamel-yaml==0.18.14
325323
# via datumaro
326324
ruamel-yaml-clib==0.2.12
327325
# via ruamel-yaml
328326
rules==3.5
329327
# via -r cvat/requirements/base.in
330328
s3transfer==0.13.0
331329
# via boto3
332-
scikit-learn==1.6.1
330+
scikit-learn==1.7.0
333331
# via datumaro
334332
scipy==1.13.1
335333
# via
@@ -349,11 +347,11 @@ sqlparse==0.5.3
349347
# via django
350348
tabulate==0.9.0
351349
# via datumaro
352-
tensorboardx==2.6.2.2
350+
tensorboardx==2.6.4
353351
# via datumaro
354352
threadpoolctl==3.6.0
355353
# via scikit-learn
356-
typing-extensions==4.13.2
354+
typing-extensions==4.14.0
357355
# via
358356
# asgiref
359357
# azure-core
@@ -363,9 +361,9 @@ typing-extensions==4.13.2
363361
# pottery
364362
tzdata==2025.2
365363
# via pandas
366-
uritemplate==4.1.1
364+
uritemplate==4.2.0
367365
# via drf-spectacular
368-
urllib3==2.4.0
366+
urllib3==2.5.0
369367
# via
370368
# botocore
371369
# clickhouse-connect
@@ -376,7 +374,7 @@ xmlsec==1.3.15
376374
# via
377375
# -r cvat/requirements/base.in
378376
# python3-saml
379-
zipp==3.22.0
377+
zipp==3.23.0
380378
# via importlib-metadata
381379
zstandard==0.23.0
382380
# via clickhouse-connect

cvat/requirements/development.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@
44
# To update it, refer to cvat/requirements/README.txt.
55
#
66
-r base.txt
7-
autopep8==2.3.2
8-
# via django-silk
97
django-extensions==3.0.8
108
# via -r cvat/requirements/development.in
11-
django-silk==5.3.2
9+
django-silk==5.4.0
1210
# via -r cvat/requirements/development.in
1311
gprof2dot==2025.4.14
1412
# via django-silk
15-
pycodestyle==2.13.0
16-
# via autopep8
1713
rope==0.17.0
1814
# via -r cvat/requirements/development.in
1915
snakeviz==2.1.0
2016
# via -r cvat/requirements/development.in
21-
tomli==2.2.1
22-
# via autopep8
2317
tornado==6.5.1
2418
# via snakeviz

cvat/requirements/production.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ uvicorn[standard]==0.22.0
2222
# via -r cvat/requirements/production.in
2323
uvloop==0.21.0
2424
# via uvicorn
25-
watchfiles==1.0.5
25+
watchfiles==1.1.0
2626
# via uvicorn
2727
websockets==15.0.1
2828
# via uvicorn

cvat/requirements/testing.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
-r development.txt
77
coverage==7.2.3
88
# via -r cvat/requirements/testing.in
9-
fakeredis[lua]==2.29.0
9+
fakeredis[lua]==2.30.1
1010
# via -r cvat/requirements/testing.in
11-
lupa==2.4
11+
lupa==2.5
1212
# via fakeredis
1313
sortedcontainers==2.4.0
1414
# via fakeredis

tests/python/rest_api/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,13 @@ def create_task(username, spec, data, content_type="application/json", **kwargs)
471471

472472

473473
def compare_annotations(a: dict, b: dict) -> dict:
474-
def _exclude_cb(obj, path):
474+
def _exclude_cb(obj, path: str):
475+
# ignoring track elements which do not have shapes
476+
split_path = path.rsplit("['elements']", maxsplit=1)
477+
if len(split_path) == 2:
478+
if split_path[1].count("[") == 1 and not obj["shapes"]:
479+
return True
480+
475481
return path.endswith("['elements']") and not obj
476482

477483
return DeepDiff(

0 commit comments

Comments
 (0)