Răsfoiți Sursa

Add --keep-prev option for video annotation

Kentaro Wada 7 ani în urmă
părinte
comite
1cd15022cd
2 a modificat fișierele cu 11 adăugiri și 0 ștergeri
  1. 10 0
      labelme/app.py
  2. 1 0
      labelme/config/default_config.yaml

+ 10 - 0
labelme/app.py

@@ -908,7 +908,11 @@ class MainWindow(QtWidgets.QMainWindow, WindowMixin):
             return False
         self.image = image
         self.filename = filename
+        if self._config['keep_prev']:
+            prev_shapes = self.canvas.shapes
         self.canvas.loadPixmap(QtGui.QPixmap.fromImage(image))
+        if self._config['keep_prev']:
+            self.loadShapes(prev_shapes)
         if self.labelFile:
             self.loadLabels(self.labelFile.shapes)
             if self.labelFile.flags is not None:
@@ -1283,6 +1287,12 @@ def main():
         help='label validation types',
         default=argparse.SUPPRESS,
     )
+    parser.add_argument(
+        '--keep-prev',
+        action='store_true',
+        help='keep annotation of previous frame',
+        default=argparse.SUPPRESS,
+    )
     args = parser.parse_args()
 
     if args.version:

+ 1 - 0
labelme/config/default_config.yaml

@@ -1,5 +1,6 @@
 auto_save: false
 store_data: true
+keep_prev: false
 
 flags: null
 labels: null