From 56ebca3e509e09a3da85e393e6f4f158f566383f Mon Sep 17 00:00:00 2001 From: etiennp Date: Wed, 4 Dec 2024 13:44:54 +0100 Subject: [PATCH 1/2] add key frames before box --- boundingbox/static/boundingbox/boundingbox.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boundingbox/static/boundingbox/boundingbox.js b/boundingbox/static/boundingbox/boundingbox.js index 4b6cab4..a641a4f 100644 --- a/boundingbox/static/boundingbox/boundingbox.js +++ b/boundingbox/static/boundingbox/boundingbox.js @@ -71,6 +71,7 @@ function setupSegmentation() { return; g_paint = false; g_annotationHasChanged = true; + addKeyFrame(g_currentFrameNr); addBox(g_currentFrameNr, g_BBx, g_BBy, g_BBx2, g_BBy2, g_currentLabel); console.log('finished BB on ' + g_BBx + ' ' + g_BBy); }); @@ -78,6 +79,7 @@ function setupSegmentation() { $('#canvas').mouseleave(function(e){ if(g_paint) { g_annotationHasChanged = true; + addKeyFrame(g_currentFrameNr); addBox(g_currentFrameNr, g_BBx, g_BBy, g_BBx2, g_BBy2, g_currentLabel); redrawSequence(); g_paint = false; From 02ba7efb2f4a4b770c2e5ee920ea7c46044afb50 Mon Sep 17 00:00:00 2001 From: etiennp Date: Wed, 11 Dec 2024 16:54:11 +0100 Subject: [PATCH 2/2] key frame should not be added simply by clicking if treating a sequence --- boundingbox/static/boundingbox/boundingbox.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boundingbox/static/boundingbox/boundingbox.js b/boundingbox/static/boundingbox/boundingbox.js index a641a4f..cea625a 100644 --- a/boundingbox/static/boundingbox/boundingbox.js +++ b/boundingbox/static/boundingbox/boundingbox.js @@ -71,7 +71,9 @@ function setupSegmentation() { return; g_paint = false; g_annotationHasChanged = true; - addKeyFrame(g_currentFrameNr); + if(g_sequenceLength === 0){ + addKeyFrame(g_currentFrameNr); + } addBox(g_currentFrameNr, g_BBx, g_BBy, g_BBx2, g_BBy2, g_currentLabel); console.log('finished BB on ' + g_BBx + ' ' + g_BBy); }); @@ -79,7 +81,9 @@ function setupSegmentation() { $('#canvas').mouseleave(function(e){ if(g_paint) { g_annotationHasChanged = true; - addKeyFrame(g_currentFrameNr); + if(g_sequenceLength === 0){ + addKeyFrame(g_currentFrameNr); + } addBox(g_currentFrameNr, g_BBx, g_BBy, g_BBx2, g_BBy2, g_currentLabel); redrawSequence(); g_paint = false;