Skip to content

Commit

Permalink
Fixed lambda project labels (#2725)
Browse files Browse the repository at this point in the history
* Fixed lambda project labels

* Added CHANGELOG

Co-authored-by: Nikita Manovich <[email protected]>
  • Loading branch information
ActiveChooN and Nikita Manovich authored Jan 27, 2021
1 parent 16b7915 commit 30678f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The cursor jumps to the end of the line when renaming a task (<https://github.com/openvinotoolkit/cvat/pull/2669>)
- SSLCertVerificationError when remote source is used (<https://github.com/openvinotoolkit/cvat/pull/2683>)
- Fixed filters select overflow (<https://github.com/openvinotoolkit/cvat/pull/2614>)
- Fixed tasks in project autoannotation (<https://github.com/openvinotoolkit/cvat/pull/2725>)
- Cuboids are missed in annotations statistics (<https://github.com/openvinotoolkit/cvat/pull/2704>)
- The list of files attached to the task is not displayed (<https://github.com/openvinotoolkit/cvat/pull/2706>)

Expand Down
6 changes: 4 additions & 2 deletions cvat/apps/lambda_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ def invoke(self, db_task, data):
quality = data.get("quality")
mapping = data.get("mapping")
mapping_by_default = {db_label.name:db_label.name
for db_label in db_task.label_set.all()}
for db_label in (
db_task.project.label_set if db_task.project_id else db_task.label_set
).all()}
if not mapping:
# use mapping by default to avoid labels in mapping which
# don't exist in the task
Expand Down Expand Up @@ -477,7 +479,7 @@ def __call__(function, task, quality, cleanup, **kwargs):
db_task = TaskModel.objects.get(pk=task)
if cleanup:
dm.task.delete_task_data(db_task.id)
db_labels = db_task.label_set.prefetch_related("attributespec_set").all()
db_labels = (db_task.project.label_set if db_task.project_id else db_task.label_set).prefetch_related("attributespec_set").all()
labels = {db_label.name:db_label.id for db_label in db_labels}

if function.kind == LambdaType.DETECTOR:
Expand Down

0 comments on commit 30678f9

Please sign in to comment.