Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
279f01b5
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
279f01b5
编写于
11月 24, 2022
作者:
A
Anastasia Yasakova
提交者:
GitHub
11月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix: Can't dump annotations with objects type is track from several jobs (#5250)
上级
dde9f610
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
35 deletion
+40
-35
CHANGELOG.md
CHANGELOG.md
+1
-0
cvat/apps/dataset_manager/annotation.py
cvat/apps/dataset_manager/annotation.py
+11
-9
cvat/apps/dataset_manager/tests/test_rest_api_formats.py
cvat/apps/dataset_manager/tests/test_rest_api_formats.py
+28
-26
未找到文件。
CHANGELOG.md
浏览文件 @
279f01b5
...
@@ -74,6 +74,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
...
@@ -74,6 +74,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
-
Added "type" field for all the labels, allows to reduce number of controls on annotation view (
<https://github.com/opencv/cvat/pull/5273>
)
-
Added "type" field for all the labels, allows to reduce number of controls on annotation view (
<https://github.com/opencv/cvat/pull/5273>
)
-
Occluded not applied on canvas instantly for a skeleton elements (
<https://github.com/opencv/cvat/pull/5259>
)
-
Occluded not applied on canvas instantly for a skeleton elements (
<https://github.com/opencv/cvat/pull/5259>
)
-
Oriented bounding boxes broken with COCO format ss(
<https://github.com/opencv/cvat/pull/5219>
)
-
Oriented bounding boxes broken with COCO format ss(
<https://github.com/opencv/cvat/pull/5219>
)
-
Can't dump annotations with objects type is track from several jobs (
<https://github.com/opencv/cvat/pull/5250>
)
-
Fixed upload resumption in production environments
-
Fixed upload resumption in production environments
(
<https://github.com/opencv/cvat/issues/4839>
)
(
<https://github.com/opencv/cvat/issues/4839>
)
-
Fixed job exporting (
<https://github.com/opencv/cvat/pull/5282>
)
-
Fixed job exporting (
<https://github.com/opencv/cvat/pull/5282>
)
...
...
cvat/apps/dataset_manager/annotation.py
浏览文件 @
279f01b5
...
@@ -105,7 +105,7 @@ class AnnotationIR:
...
@@ -105,7 +105,7 @@ class AnnotationIR:
if
scoped_shapes
:
if
scoped_shapes
:
if
not
scoped_shapes
[
0
][
'keyframe'
]:
if
not
scoped_shapes
[
0
][
'keyframe'
]:
segment_shapes
.
insert
(
0
,
scoped_shapes
[
0
])
segment_shapes
.
insert
(
0
,
scoped_shapes
[
0
])
if
not
scoped_shapes
[
-
1
][
'keyframe'
]
and
\
if
scoped_shapes
[
-
1
][
'keyframe'
]
and
\
scoped_shapes
[
-
1
][
'outside'
]:
scoped_shapes
[
-
1
][
'outside'
]:
segment_shapes
.
append
(
scoped_shapes
[
-
1
])
segment_shapes
.
append
(
scoped_shapes
[
-
1
])
elif
stop
+
1
<
len
(
interpolated_shapes
)
and
\
elif
stop
+
1
<
len
(
interpolated_shapes
)
and
\
...
@@ -737,11 +737,18 @@ class TrackManager(ObjectManager):
...
@@ -737,11 +737,18 @@ class TrackManager(ObjectManager):
return
shapes
return
shapes
shapes
=
[]
shapes
=
[]
curr_frame
=
track
[
"shapes"
][
0
][
"frame"
]
prev_shape
=
{}
prev_shape
=
{}
for
shape
in
track
[
"shapes"
]:
for
shape
in
sorted
(
track
[
"shapes"
],
key
=
lambda
shape
:
shape
[
"frame"
]):
curr_frame
=
shape
[
"frame"
]
if
end_frame
<=
curr_frame
:
if
not
prev_shape
:
shape
[
"keyframe"
]
=
True
shapes
.
append
(
shape
)
prev_shape
=
shape
break
if
prev_shape
:
if
prev_shape
:
assert
shape
[
"frame"
]
>
curr_frame
assert
shape
[
"frame"
]
>
prev_shape
[
"frame"
]
for
attr
in
prev_shape
[
"attributes"
]:
for
attr
in
prev_shape
[
"attributes"
]:
if
attr
[
"spec_id"
]
not
in
map
(
lambda
el
:
el
[
"spec_id"
],
shape
[
"attributes"
]):
if
attr
[
"spec_id"
]
not
in
map
(
lambda
el
:
el
[
"spec_id"
],
shape
[
"attributes"
]):
shape
[
"attributes"
].
append
(
deepcopy
(
attr
))
shape
[
"attributes"
].
append
(
deepcopy
(
attr
))
...
@@ -750,13 +757,8 @@ class TrackManager(ObjectManager):
...
@@ -750,13 +757,8 @@ class TrackManager(ObjectManager):
shape
[
"keyframe"
]
=
True
shape
[
"keyframe"
]
=
True
shapes
.
append
(
shape
)
shapes
.
append
(
shape
)
curr_frame
=
shape
[
"frame"
]
prev_shape
=
shape
prev_shape
=
shape
# keep at least 1 shape
if
end_frame
<=
curr_frame
:
break
if
not
prev_shape
[
"outside"
]:
if
not
prev_shape
[
"outside"
]:
shape
=
deepcopy
(
prev_shape
)
shape
=
deepcopy
(
prev_shape
)
shape
[
"frame"
]
=
end_frame
shape
[
"frame"
]
=
end_frame
...
...
cvat/apps/dataset_manager/tests/test_rest_api_formats.py
浏览文件 @
279f01b5
...
@@ -785,39 +785,41 @@ class TaskDumpUploadTest(_DbTestBase):
...
@@ -785,39 +785,41 @@ class TaskDumpUploadTest(_DbTestBase):
with
open
(
file_zip_name
,
'rb'
)
as
binary_file
:
with
open
(
file_zip_name
,
'rb'
)
as
binary_file
:
self
.
_upload_file
(
url
,
binary_file
,
self
.
admin
)
self
.
_upload_file
(
url
,
binary_file
,
self
.
admin
)
def
test_api_v2_dump_annotations_
with_objects_type_is_shape_
from_several_jobs
(
self
):
def
test_api_v2_dump_annotations_from_several_jobs
(
self
):
test_name
=
self
.
_testMethodName
test_name
=
self
.
_testMethodName
dump_format
_name
=
"CVAT for images 1.1"
dump_format
s
=
[
"CVAT for images 1.1"
,
"CVAT for video 1.1"
]
test_cases
=
[
'all'
,
'first'
]
test_cases
=
[
'all'
,
'first'
]
images
=
self
.
_generate_task_images
(
10
)
for
dump_format_name
in
dump_formats
:
task
=
self
.
_create_task
(
tasks
[
"change overlap and segment size"
],
images
)
task_id
=
task
[
"id"
]
for
test_case
in
test_cases
:
images
=
self
.
_generate_task_images
(
10
)
with
TestDir
()
as
test_dir
:
task
=
self
.
_create_task
(
tasks
[
"change overlap and segment size"
],
images
)
jobs
=
self
.
_get_jobs
(
task_id
)
task_id
=
task
[
"id"
]
if
test_case
==
"all"
:
for
job
in
jobs
:
self
.
_create_annotations_in_job
(
task
,
job
[
"id"
],
dump_format_name
,
"default"
)
else
:
self
.
_create_annotations_in_job
(
task
,
jobs
[
0
][
"id"
],
dump_format_name
,
"default"
)
url
=
self
.
_generate_url_dump_tasks_annotations
(
task_id
)
for
test_case
in
test_cases
:
with
TestDir
()
as
test_dir
:
jobs
=
self
.
_get_jobs
(
task_id
)
if
test_case
==
"all"
:
for
job
in
jobs
:
self
.
_create_annotations_in_job
(
task
,
job
[
"id"
],
dump_format_name
,
"default"
)
else
:
self
.
_create_annotations_in_job
(
task
,
jobs
[
0
][
"id"
],
dump_format_name
,
"default"
)
file_zip_name
=
osp
.
join
(
test_dir
,
f
'
{
test_name
}
.zip'
)
url
=
self
.
_generate_url_dump_tasks_annotations
(
task_id
)
data
=
{
"format"
:
dump_format_name
,
"action"
:
"download"
,
}
self
.
_download_file
(
url
,
data
,
self
.
admin
,
file_zip_name
)
self
.
assertEqual
(
osp
.
exists
(
file_zip_name
),
True
)
# remove annotations
file_zip_name
=
osp
.
join
(
test_dir
,
f
'
{
test_name
}
.zip'
)
self
.
_remove_annotations
(
url
,
self
.
admin
)
data
=
{
url
=
self
.
_generate_url_upload_tasks_annotations
(
task_id
,
"CVAT 1.1"
)
"format"
:
dump_format_name
,
with
open
(
file_zip_name
,
'rb'
)
as
binary_file
:
"action"
:
"download"
,
self
.
_upload_file
(
url
,
binary_file
,
self
.
admin
)
}
self
.
_download_file
(
url
,
data
,
self
.
admin
,
file_zip_name
)
self
.
assertEqual
(
osp
.
exists
(
file_zip_name
),
True
)
# remove annotations
self
.
_remove_annotations
(
url
,
self
.
admin
)
url
=
self
.
_generate_url_upload_tasks_annotations
(
task_id
,
"CVAT 1.1"
)
with
open
(
file_zip_name
,
'rb'
)
as
binary_file
:
self
.
_upload_file
(
url
,
binary_file
,
self
.
admin
)
def
test_api_v2_export_dataset
(
self
):
def
test_api_v2_export_dataset
(
self
):
test_name
=
self
.
_testMethodName
test_name
=
self
.
_testMethodName
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录