Skip to content

Commit

Permalink
Fixed issue with track
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Sep 24, 2020
1 parent f28dd38 commit 5421be9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions cvat-core/src/annotations-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,15 +857,25 @@
? (frame) => frame + 1
: (frame) => frame - 1;
for (let frame = frameFrom; predicate(frame); frame = update(frame)) {
if (frame in this.shapes) continue;
if (frame in this.tags) continue;
if (frame in this.shapes && this.shapes[frame].some((shape) => !shape.removed)) {
continue;
}
if (frame in this.tags && this.tags[frame].some((tag) => !tag.removed)) {
continue;
}
const filteredTracks = this.tracks.filter((track) => !track.removed);
let found = false;
for (const track of this.tracks) {
if (frame in track.shapes) {
for (const track of filteredTracks) {
const { prev, first } = track.boundedKeyframes(frame);
const last = prev === null ? first : prev;
const lastShape = track.shapes[last];
const isKeyfame = frame in track.shapes;
if (first <= frame && (!lastShape.outside || isKeyfame)) {
found = true;
break;
}
}

if (found) continue;

return frame;
Expand Down

0 comments on commit 5421be9

Please sign in to comment.