Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
bddd4464
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,发现更多精彩内容 >>
未验证
提交
bddd4464
编写于
7月 05, 2022
作者:
M
Maxim Zhiltsov
提交者:
GitHub
7月 05, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix pylint issues (#100)
上级
57bc0e9c
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
83 addition
and
74 deletion
+83
-74
cvat/apps/dataset_manager/annotation.py
cvat/apps/dataset_manager/annotation.py
+2
-2
cvat/apps/dataset_manager/bindings.py
cvat/apps/dataset_manager/bindings.py
+30
-18
cvat/apps/dataset_manager/formats/imagenet.py
cvat/apps/dataset_manager/formats/imagenet.py
+1
-1
cvat/apps/dataset_manager/formats/market1501.py
cvat/apps/dataset_manager/formats/market1501.py
+1
-1
cvat/apps/dataset_manager/formats/mot.py
cvat/apps/dataset_manager/formats/mot.py
+2
-2
cvat/apps/dataset_manager/formats/mots.py
cvat/apps/dataset_manager/formats/mots.py
+1
-1
cvat/apps/dataset_manager/formats/velodynepoint.py
cvat/apps/dataset_manager/formats/velodynepoint.py
+3
-8
cvat/apps/dataset_manager/util.py
cvat/apps/dataset_manager/util.py
+1
-1
cvat/apps/dataset_repo/dataset_repo.py
cvat/apps/dataset_repo/dataset_repo.py
+3
-1
cvat/apps/dataset_repo/management/__init__.py
cvat/apps/dataset_repo/management/__init__.py
+1
-1
cvat/apps/dataset_repo/management/commands/__init__.py
cvat/apps/dataset_repo/management/commands/__init__.py
+1
-1
cvat/apps/engine/media_extractors.py
cvat/apps/engine/media_extractors.py
+14
-14
cvat/apps/engine/parsers.py
cvat/apps/engine/parsers.py
+1
-1
cvat/apps/engine/renderers.py
cvat/apps/engine/renderers.py
+1
-1
cvat/apps/iam/__init__.py
cvat/apps/iam/__init__.py
+1
-1
cvat/apps/iam/admin.py
cvat/apps/iam/admin.py
+1
-1
cvat/apps/iam/schema.py
cvat/apps/iam/schema.py
+1
-1
cvat/apps/iam/urls.py
cvat/apps/iam/urls.py
+1
-1
cvat/apps/iam/views.py
cvat/apps/iam/views.py
+5
-5
cvat/apps/lambda_manager/views.py
cvat/apps/lambda_manager/views.py
+1
-1
cvat/apps/organizations/views.py
cvat/apps/organizations/views.py
+1
-1
cvat/apps/profiler.py
cvat/apps/profiler.py
+2
-2
tests/rest_api/fixtures/data.py
tests/rest_api/fixtures/data.py
+3
-3
tests/rest_api/test_invitations.py
tests/rest_api/test_invitations.py
+2
-2
utils/dataset_manifest/__init__.py
utils/dataset_manifest/__init__.py
+1
-1
utils/dataset_manifest/core.py
utils/dataset_manifest/core.py
+1
-1
utils/dataset_manifest/create.py
utils/dataset_manifest/create.py
+1
-1
未找到文件。
cvat/apps/dataset_manager/annotation.py
浏览文件 @
bddd4464
...
...
@@ -70,8 +70,8 @@ class AnnotationIR:
prev_shape
=
None
for
shape
in
track
[
'shapes'
]:
if
prev_shape
and
not
prev_shape
[
'outside'
]
and
\
has_overlap
(
prev_shape
[
'frame'
],
shape
[
'frame'
]):
return
True
has_overlap
(
prev_shape
[
'frame'
],
shape
[
'frame'
]):
return
True
prev_shape
=
shape
if
not
prev_shape
[
'outside'
]
and
prev_shape
[
'frame'
]
<=
stop
:
...
...
cvat/apps/dataset_manager/bindings.py
浏览文件 @
bddd4464
...
...
@@ -1434,7 +1434,8 @@ def import_dm_annotations(dm_dataset: Dataset, instance_data: Union[TaskData, Pr
if
isinstance
(
instance_data
,
ProjectData
):
for
sub_dataset
,
task_data
in
instance_data
.
split_dataset
(
dm_dataset
):
# FIXME: temporary workaround for cvat format, will be removed after migration importer to datumaro
# FIXME: temporary workaround for cvat format
# will be removed after migration importer to datumaro
sub_dataset
.
_format
=
dm_dataset
.
format
import_dm_annotations
(
sub_dataset
,
task_data
)
return
...
...
@@ -1477,6 +1478,12 @@ def import_dm_annotations(dm_dataset: Dataset, instance_data: Union[TaskData, Pr
try
:
if
hasattr
(
ann
,
'label'
)
and
ann
.
label
is
None
:
raise
CvatImportError
(
"annotation has no label"
)
attributes
=
[
instance_data
.
Attribute
(
name
=
n
,
value
=
str
(
v
))
for
n
,
v
in
ann
.
attributes
.
items
()
]
if
ann
.
type
in
shapes
:
if
ann
.
type
==
datum_annotation
.
AnnotationType
.
cuboid_3d
:
try
:
...
...
@@ -1485,44 +1492,50 @@ def import_dm_annotations(dm_dataset: Dataset, instance_data: Union[TaskData, Pr
ann
.
points
=
ann
.
points
ann
.
z_order
=
0
# Use safe casting to bool instead of plain reading
# because in some formats return type can be different
# from bool / None
# https://github.com/openvinotoolkit/datumaro/issues/719
occluded
=
cast
(
ann
.
attributes
.
pop
(
'occluded'
,
None
),
bool
)
is
True
keyframe
=
cast
(
ann
.
attributes
.
get
(
'keyframe'
,
None
),
bool
)
is
True
outside
=
cast
(
ann
.
attributes
.
pop
(
'outside'
,
None
),
bool
)
is
True
track_id
=
ann
.
attributes
.
pop
(
'track_id'
,
None
)
source
=
ann
.
attributes
.
pop
(
'source'
).
lower
()
\
if
ann
.
attributes
.
get
(
'source'
,
''
).
lower
()
in
{
'auto'
,
'manual'
}
else
'manual'
if
track_id
is
None
or
dm_dataset
.
format
!=
'cvat'
:
instance_data
.
add_shape
(
instance_data
.
LabeledShape
(
type
=
shapes
[
ann
.
type
],
frame
=
frame_number
,
points
=
ann
.
points
,
label
=
label_cat
.
items
[
ann
.
label
].
name
,
occluded
=
ann
.
attributes
.
pop
(
'occluded'
,
None
)
==
True
,
occluded
=
occluded
,
z_order
=
ann
.
z_order
,
group
=
group_map
.
get
(
ann
.
group
,
0
),
source
=
str
(
ann
.
attributes
.
pop
(
'source'
)).
lower
()
\
if
str
(
ann
.
attributes
.
get
(
'source'
,
None
)).
lower
()
in
{
'auto'
,
'manual'
}
else
'manual'
,
attributes
=
[
instance_data
.
Attribute
(
name
=
n
,
value
=
str
(
v
))
for
n
,
v
in
ann
.
attributes
.
items
()],
source
=
source
,
attributes
=
attributes
,
))
continue
if
ann
.
attributes
.
get
(
'keyframe'
,
None
)
==
True
or
ann
.
attributes
.
get
(
'outside'
,
None
)
==
Tru
e
:
if
keyframe
or
outsid
e
:
track
=
instance_data
.
TrackedShape
(
type
=
shapes
[
ann
.
type
],
frame
=
frame_number
,
occluded
=
ann
.
attributes
.
pop
(
'occluded'
,
None
)
==
True
,
outside
=
ann
.
attributes
.
pop
(
'outside'
,
None
)
==
Tru
e
,
keyframe
=
ann
.
attributes
.
get
(
'keyframe'
,
None
)
==
Tru
e
,
occluded
=
occluded
,
outside
=
outsid
e
,
keyframe
=
keyfram
e
,
points
=
ann
.
points
,
z_order
=
ann
.
z_order
,
source
=
str
(
ann
.
attributes
.
pop
(
'source'
)).
lower
()
\
if
str
(
ann
.
attributes
.
get
(
'source'
,
None
)).
lower
()
in
{
'auto'
,
'manual'
}
else
'manual'
,
attributes
=
[
instance_data
.
Attribute
(
name
=
n
,
value
=
str
(
v
))
for
n
,
v
in
ann
.
attributes
.
items
()],
source
=
source
,
attributes
=
attributes
,
)
if
track_id
not
in
tracks
:
tracks
[
track_id
]
=
instance_data
.
Track
(
label
=
label_cat
.
items
[
ann
.
label
].
name
,
group
=
group_map
.
get
(
ann
.
group
,
0
),
source
=
str
(
ann
.
attributes
.
pop
(
'source'
)).
lower
()
\
if
str
(
ann
.
attributes
.
get
(
'source'
,
None
)).
lower
()
in
{
'auto'
,
'manual'
}
else
'manual'
,
source
=
source
,
shapes
=
[],
)
...
...
@@ -1534,8 +1547,7 @@ def import_dm_annotations(dm_dataset: Dataset, instance_data: Union[TaskData, Pr
label
=
label_cat
.
items
[
ann
.
label
].
name
,
group
=
group_map
.
get
(
ann
.
group
,
0
),
source
=
'manual'
,
attributes
=
[
instance_data
.
Attribute
(
name
=
n
,
value
=
str
(
v
))
for
n
,
v
in
ann
.
attributes
.
items
()],
attributes
=
attributes
,
))
except
Exception
as
e
:
raise
CvatImportError
(
"Image {}: can't import annotation "
...
...
cvat/apps/dataset_manager/formats/imagenet.py
浏览文件 @
bddd4464
...
...
@@ -38,4 +38,4 @@ def _import(src_file, instance_data, load_data_callback=None):
dataset
=
Dataset
.
import_from
(
tmp_dir
,
'imagenet'
,
env
=
dm_env
)
if
load_data_callback
is
not
None
:
load_data_callback
(
dataset
,
instance_data
)
import_dm_annotations
(
dataset
,
instance_data
)
\ No newline at end of file
import_dm_annotations
(
dataset
,
instance_data
)
cvat/apps/dataset_manager/formats/market1501.py
浏览文件 @
bddd4464
...
...
@@ -50,7 +50,7 @@ class LabelAttrToAttr(ItemTransform):
def
transform_item
(
self
,
item
):
annotations
=
list
(
item
.
annotations
)
attributes
=
dict
(
item
.
attributes
)
if
self
.
_label
!=
None
:
if
self
.
_label
is
not
None
:
labels
=
[
ann
for
ann
in
annotations
if
ann
.
type
==
AnnotationType
.
label
\
and
ann
.
label
==
self
.
_label
]
...
...
cvat/apps/dataset_manager/formats/mot.py
浏览文件 @
bddd4464
...
...
@@ -32,7 +32,7 @@ def _import_task(dataset, task_data):
type
=
'rectangle'
,
label
=
label_cat
.
items
[
ann
.
label
].
name
,
points
=
ann
.
points
,
occluded
=
ann
.
attributes
.
get
(
'occluded'
)
==
True
,
occluded
=
ann
.
attributes
.
get
(
'occluded'
)
is
True
,
z_order
=
ann
.
z_order
,
group
=
0
,
frame
=
frame_number
,
...
...
@@ -44,7 +44,7 @@ def _import_task(dataset, task_data):
shape
=
task_data
.
TrackedShape
(
type
=
'rectangle'
,
points
=
ann
.
points
,
occluded
=
ann
.
attributes
.
get
(
'occluded'
)
==
True
,
occluded
=
ann
.
attributes
.
get
(
'occluded'
)
is
True
,
outside
=
False
,
keyframe
=
True
,
z_order
=
ann
.
z_order
,
...
...
cvat/apps/dataset_manager/formats/mots.py
浏览文件 @
bddd4464
...
...
@@ -52,7 +52,7 @@ def _import_task(dataset, task_data):
shape
=
task_data
.
TrackedShape
(
type
=
'polygon'
,
points
=
ann
.
points
,
occluded
=
ann
.
attributes
.
get
(
'occluded'
)
==
True
,
occluded
=
ann
.
attributes
.
get
(
'occluded'
)
is
True
,
outside
=
False
,
keyframe
=
True
,
z_order
=
ann
.
z_order
,
...
...
cvat/apps/dataset_manager/formats/velodynepoint.py
浏览文件 @
bddd4464
...
...
@@ -19,7 +19,6 @@ from .registry import exporter, importer
@
exporter
(
name
=
'Kitti Raw Format'
,
ext
=
'ZIP'
,
version
=
'1.0'
,
dimension
=
DimensionType
.
DIM_3D
)
def
_export_images
(
dst_file
,
task_data
,
save_images
=
False
):
dataset
=
Dataset
.
from_extractors
(
GetCVATDataExtractor
(
task_data
,
include_images
=
save_images
,
format_type
=
"kitti_raw"
,
dimension
=
DimensionType
.
DIM_3D
),
env
=
dm_env
)
...
...
@@ -33,14 +32,10 @@ def _export_images(dst_file, task_data, save_images=False):
def
_import
(
src_file
,
instance_data
,
load_data_callback
=
None
):
with
TemporaryDirectory
()
as
tmp_dir
:
if
zipfile
.
is_zipfile
(
src_file
):
zipfile
.
ZipFile
(
src_file
).
extractall
(
tmp_dir
)
dataset
=
Dataset
.
import_from
(
tmp_dir
,
'kitti_raw'
,
env
=
dm_env
)
zipfile
.
ZipFile
(
src_file
).
extractall
(
tmp_dir
)
dataset
=
Dataset
.
import_from
(
tmp_dir
,
'kitti_raw'
,
env
=
dm_env
)
else
:
dataset
=
Dataset
.
import_from
(
src_file
.
name
,
'kitti_raw'
,
env
=
dm_env
)
dataset
=
Dataset
.
import_from
(
src_file
.
name
,
'kitti_raw'
,
env
=
dm_env
)
if
load_data_callback
is
not
None
:
load_data_callback
(
dataset
,
instance_data
)
import_dm_annotations
(
dataset
,
instance_data
)
cvat/apps/dataset_manager/util.py
浏览文件 @
bddd4464
...
...
@@ -34,4 +34,4 @@ def bulk_create(db_model, objects, flt_param):
else
:
return
db_model
.
objects
.
bulk_create
(
objects
)
return
[]
\ No newline at end of file
return
[]
cvat/apps/dataset_repo/dataset_repo.py
浏览文件 @
bddd4464
...
...
@@ -463,7 +463,9 @@ def update_states():
try
:
get
(
db_git
.
task_id
,
db_user
)
except
Exception
:
slogger
.
glob
(
"Exception occurred during a status updating for db_git with tid: {}"
.
format
(
db_git
.
task_id
))
slogger
.
glob
.
exception
(
"Exception occurred during a status "
"updating for db_git with tid: {}"
.
format
(
db_git
.
task_id
),
exc_info
=
True
)
@
transaction
.
atomic
def
_onsave
(
jid
,
data
,
action
):
...
...
cvat/apps/dataset_repo/management/__init__.py
浏览文件 @
bddd4464
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
\ No newline at end of file
# SPDX-License-Identifier: MIT
cvat/apps/dataset_repo/management/commands/__init__.py
浏览文件 @
bddd4464
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
\ No newline at end of file
# SPDX-License-Identifier: MIT
cvat/apps/engine/media_extractors.py
浏览文件 @
bddd4464
...
...
@@ -494,7 +494,7 @@ class FragmentMediaReader:
if
idx
<
self
.
_start_chunk_frame_number
:
continue
elif
idx
<
self
.
_end_chunk_frame_number
and
\
not
(
(
idx
-
self
.
_start_chunk_frame_number
)
%
self
.
_step
)
:
not
(
idx
-
self
.
_start_chunk_frame_number
)
%
self
.
_step
:
frame_range
.
append
(
idx
)
elif
(
idx
-
self
.
_start_chunk_frame_number
)
%
self
.
_step
:
continue
...
...
@@ -654,20 +654,20 @@ class Mpeg4ChunkWriter(IChunkWriter):
}
def
_create_av_container
(
self
,
path
,
w
,
h
,
rate
,
options
,
f
=
'mp4'
):
# x264 requires width and height must be divisible by 2 for yuv420p
if
h
%
2
:
h
+=
1
if
w
%
2
:
w
+=
1
# x264 requires width and height must be divisible by 2 for yuv420p
if
h
%
2
:
h
+=
1
if
w
%
2
:
w
+=
1
container
=
av
.
open
(
path
,
'w'
,
format
=
f
)
video_stream
=
container
.
add_stream
(
self
.
_codec_name
,
rate
=
rate
)
video_stream
.
pix_fmt
=
"yuv420p"
video_stream
.
width
=
w
video_stream
.
height
=
h
video_stream
.
options
=
options
container
=
av
.
open
(
path
,
'w'
,
format
=
f
)
video_stream
=
container
.
add_stream
(
self
.
_codec_name
,
rate
=
rate
)
video_stream
.
pix_fmt
=
"yuv420p"
video_stream
.
width
=
w
video_stream
.
height
=
h
video_stream
.
options
=
options
return
container
,
video_stream
return
container
,
video_stream
def
save_as_chunk
(
self
,
images
,
chunk_path
):
if
not
images
:
...
...
@@ -779,7 +779,7 @@ def _is_zip(path):
# 'mode': 'annotation' or 'interpolation' - mode of task that should be created.
# 'unique': True or False - describes how the type can be combined with other.
# True - only one item of this type and no other is allowed
# False - this media types can be combined with other which have unique
==
False
# False - this media types can be combined with other which have unique
is
False
MEDIA_TYPES
=
{
'image'
:
{
...
...
cvat/apps/engine/parsers.py
浏览文件 @
bddd4464
...
...
@@ -14,4 +14,4 @@ class TusUploadParser(BaseParser):
# exception because a parser for the request with the non-standard
# content media type isn't defined.
# https://github.com/imtapps/django-rest-framework/blob/master/docs/api-guide/parsers.md
return
{}
\ No newline at end of file
return
{}
cvat/apps/engine/renderers.py
浏览文件 @
bddd4464
...
...
@@ -5,4 +5,4 @@
from
rest_framework.renderers
import
JSONRenderer
class
CVATAPIRenderer
(
JSONRenderer
):
media_type
=
'application/vnd.cvat+json'
\ No newline at end of file
media_type
=
'application/vnd.cvat+json'
cvat/apps/iam/__init__.py
浏览文件 @
bddd4464
...
...
@@ -2,4 +2,4 @@
#
# SPDX-License-Identifier: MIT
from
.schema
import
*
\ No newline at end of file
from
.schema
import
*
# force import of extensions
cvat/apps/iam/admin.py
浏览文件 @
bddd4464
...
...
@@ -23,4 +23,4 @@ class CustomGroupAdmin(GroupAdmin):
admin
.
site
.
unregister
(
User
)
admin
.
site
.
unregister
(
Group
)
admin
.
site
.
register
(
User
,
CustomUserAdmin
)
admin
.
site
.
register
(
Group
,
CustomGroupAdmin
)
\ No newline at end of file
admin
.
site
.
register
(
Group
,
CustomGroupAdmin
)
cvat/apps/iam/schema.py
浏览文件 @
bddd4464
...
...
@@ -41,4 +41,4 @@ class SignatureAuthenticationScheme(OpenApiAuthenticationExtension):
'type'
:
'apiKey'
,
'in'
:
'query'
,
'name'
:
'sign'
,
}
\ No newline at end of file
}
cvat/apps/iam/urls.py
浏览文件 @
bddd4464
...
...
@@ -38,4 +38,4 @@ if settings.IAM_TYPE == 'BASIC':
name
=
'account_email_verification_sent'
),
]
urlpatterns
=
[
path
(
'auth/'
,
include
(
urlpatterns
))]
\ No newline at end of file
urlpatterns
=
[
path
(
'auth/'
,
include
(
urlpatterns
))]
cvat/apps/iam/views.py
浏览文件 @
bddd4464
...
...
@@ -32,13 +32,13 @@ def get_context(request):
org_id
=
request
.
GET
.
get
(
'org_id'
)
org_header
=
request
.
headers
.
get
(
'X-Organization'
)
if
org_id
!=
None
and
(
org_slug
!=
None
or
org_header
!=
None
):
raise
BadRequest
(
'You cannot specify "org_id" query parameter with '
+
if
org_id
is
not
None
and
(
org_slug
is
not
None
or
org_header
is
not
None
):
raise
BadRequest
(
'You cannot specify "org_id" query parameter with '
'"org" query parameter or "X-Organization" HTTP header at the same time.'
)
if
org_slug
!=
None
and
org_header
!=
None
and
org_slug
!=
org_header
:
raise
BadRequest
(
'You cannot specify "org" query parameter and '
+
if
org_slug
is
not
None
and
org_header
is
not
None
and
org_slug
!=
org_header
:
raise
BadRequest
(
'You cannot specify "org" query parameter and '
'"X-Organization" HTTP header with different values.'
)
org_slug
=
org_slug
if
org_slug
!=
None
else
org_header
org_slug
=
org_slug
if
org_slug
is
not
None
else
org_header
org_filter
=
None
if
org_slug
:
...
...
cvat/apps/lambda_manager/views.py
浏览文件 @
bddd4464
...
...
@@ -382,7 +382,7 @@ class LambdaQueue:
def
fetch_job
(
self
,
pk
):
queue
=
self
.
_get_queue
()
job
=
queue
.
fetch_job
(
pk
)
if
job
==
None
or
not
job
.
meta
.
get
(
"lambda"
):
if
job
is
None
or
not
job
.
meta
.
get
(
"lambda"
):
raise
ValidationError
(
"{} lambda job is not found"
.
format
(
pk
),
code
=
status
.
HTTP_404_NOT_FOUND
)
...
...
cvat/apps/organizations/views.py
浏览文件 @
bddd4464
...
...
@@ -199,4 +199,4 @@ class InvitationViewSet(viewsets.ModelViewSet):
if
'accepted'
in
self
.
request
.
query_params
:
serializer
.
instance
.
accept
()
else
:
super
().
perform_update
(
serializer
)
\ No newline at end of file
super
().
perform_update
(
serializer
)
cvat/apps/profiler.py
浏览文件 @
bddd4464
from
django.apps
import
apps
if
apps
.
is_installed
(
'silk'
):
from
silk.profiling.profiler
import
silk_profile
from
silk.profiling.profiler
import
silk_profile
# pylint: disable=unused-import
else
:
from
functools
import
wraps
def
silk_profile
(
name
=
None
):
...
...
@@ -10,4 +10,4 @@ else:
def
wrapped
(
*
args
,
**
kwargs
):
return
f
(
*
args
,
**
kwargs
)
return
wrapped
return
profile
\ No newline at end of file
return
profile
tests/rest_api/fixtures/data.py
浏览文件 @
bddd4464
...
...
@@ -213,7 +213,7 @@ def org_staff(memberships):
return
set
()
else
:
return
set
(
m
[
'user'
][
'id'
]
for
m
in
memberships
if
m
[
'role'
]
in
[
'maintainer'
,
'owner'
]
and
m
[
'user'
]
!=
None
if
m
[
'role'
]
in
[
'maintainer'
,
'owner'
]
and
m
[
'user'
]
is
not
None
and
m
[
'organization'
]
==
org_id
)
return
find
...
...
@@ -224,7 +224,7 @@ def is_org_member(memberships):
return
True
else
:
return
user_id
in
set
(
m
[
'user'
][
'id'
]
for
m
in
memberships
if
m
[
'user'
]
!=
None
and
m
[
'organization'
]
==
org_id
)
if
m
[
'user'
]
is
not
None
and
m
[
'organization'
]
==
org_id
)
return
check
@
pytest
.
fixture
(
scope
=
'session'
)
...
...
@@ -273,4 +273,4 @@ def filter_tasks_with_shapes(annotations):
@
pytest
.
fixture
(
scope
=
'session'
)
def
tasks_with_shapes
(
tasks
,
filter_tasks_with_shapes
):
return
filter_tasks_with_shapes
(
tasks
)
\ No newline at end of file
return
filter_tasks_with_shapes
(
tasks
)
tests/rest_api/test_invitations.py
浏览文件 @
bddd4464
...
...
@@ -22,7 +22,7 @@ class TestCreateInvitations:
@
staticmethod
def
get_non_member_users
(
memberships
,
users
):
organization_users
=
set
(
m
[
'user'
][
'id'
]
for
m
in
memberships
if
m
[
'user'
]
!=
None
)
organization_users
=
set
(
m
[
'user'
][
'id'
]
for
m
in
memberships
if
m
[
'user'
]
is
not
None
)
non_member_users
=
[
u
for
u
in
users
if
u
[
'id'
]
not
in
organization_users
]
return
non_member_users
...
...
@@ -30,7 +30,7 @@ class TestCreateInvitations:
@
staticmethod
def
get_member
(
role
,
memberships
,
org_id
):
member
=
[
m
[
'user'
]
for
m
in
memberships
if
m
[
'role'
]
==
role
and
m
[
'organization'
]
==
org_id
and
m
[
'user'
]
!=
None
][
0
]
m
[
'organization'
]
==
org_id
and
m
[
'user'
]
is
not
None
][
0
]
return
member
...
...
utils/dataset_manifest/__init__.py
浏览文件 @
bddd4464
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
from
.core
import
VideoManifestManager
,
ImageManifestManager
,
is_manifest
\ No newline at end of file
from
.core
import
VideoManifestManager
,
ImageManifestManager
,
is_manifest
utils/dataset_manifest/core.py
浏览文件 @
bddd4464
...
...
@@ -522,7 +522,7 @@ class VideoManifestManager(_ManifestManager):
@
property
def
data
(
self
):
return
(
self
.
video_name
)
return
self
.
video_name
def
get_subset
(
self
,
subset_names
):
raise
NotImplementedError
()
...
...
utils/dataset_manifest/create.py
浏览文件 @
bddd4464
...
...
@@ -57,7 +57,7 @@ def main():
# If the source is a glob expression, we need additional processing
abs_root
=
source
while
abs_root
and
re
.
search
(
'[*?\[\]]'
,
abs_root
):
while
abs_root
and
re
.
search
(
r
'[*?\[\]]'
,
abs_root
):
abs_root
=
os
.
path
.
split
(
abs_root
)[
0
]
related_images
=
detect_related_images
(
sources
,
abs_root
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录