Fixed lambda project labels (#2725)

* Fixed lambda project labels

* Added CHANGELOG

Co-authored-by: Nikita Manovich <nikita.manovich@intel.com>
main
Dmitry Kalinin 5 years ago committed by GitHub
parent 16b7915ae2
commit 30678f9726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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>)

@ -137,7 +137,9 @@ class LambdaFunction:
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
@ -477,7 +479,7 @@ class LambdaJob:
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:

Loading…
Cancel
Save