fixed auto_annotation for multijob tasks (#515)

* fixed auto_annotation for multijob tasks
* Added note to changelog
main
Andrey Zhavoronkov 7 years ago committed by Nikita Manovich
parent 814960b887
commit 029d6bff3d

@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed annotation parser for tracks with a start frame less than the first segment frame
- Fixed interpolation on the server near outside frames
- Fixed dump for case when task name has a slash
- Fixed auto annotation fail for multijob tasks
### Security
-

@ -1179,10 +1179,12 @@ class TaskAnnotation:
stop = db_job.segment.stop_frame
jobs[jid] = { "start": start, "stop": stop }
is_frame_inside = lambda x: (start <= int(x['frame']) <= stop)
# patch_job_data function changes 'data' argument by assign IDs for saved shapes,
# in case of overlapped jobs need to make deepcopy of data here to save all shapes properly
splitted_data[jid] = {
"tags": list(filter(is_frame_inside, data['tags'])),
"shapes": list(filter(is_frame_inside, data['shapes'])),
"tracks": list(filter(lambda y: len(list(filter(is_frame_inside, y['shapes']))), data['tracks']))
"tags": copy.deepcopy(list(filter(is_frame_inside, data['tags']))),
"shapes": copy.deepcopy(list(filter(is_frame_inside, data['shapes']))),
"tracks": copy.deepcopy(list(filter(lambda y: len(list(filter(is_frame_inside, y['shapes']))), data['tracks']))),
}
for jid, job_data in splitted_data.items():

Loading…
Cancel
Save