diff --git a/README.md b/README.md index 18b3bf3a..b7da233d 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,13 @@ Open cmd and go to [labelImg] 2. Click 'Change default saved annotation folder' in Menu/File 3. Click 'Open Dir' 4. Click 'Create RectBox' +5. Click and release left mouse to select a region to annotate the rect box +6. You can use right mouse to drag the rect box to copy or move it The annotation will be saved to the folder you specify. +You can refer to the below hotkeys to speed up your workflow. + ### Create pre-defined classes You can edit the [data/predefined_classes.txt](https://github.com/tzutalin/labelImg/blob/master/data/predefined_classes.txt) to load pre-defined classes @@ -75,11 +79,16 @@ You can edit the [data/predefined_classes.txt](https://github.com/tzutalin/label | | | |----------|------------------------------------------| +| Ctrl + u | Load all of the images from a directory | | Ctrl + r | Change the default annotation target dir | | Ctrl + s | Save | -| w | Create a bounding box | +| Ctrl + d | Copy the current label and rect box | +| w | Create a rect box | | d | Next image | | a | Previous image | +| del | Delete the selected rect box | +| Ctrl++ | Zoom in | +| Ctrl-- | Zoom out | ### How to contribute Send a pull request diff --git a/labelImg.py b/labelImg.py index d7b0243e..eac0ac76 100755 --- a/labelImg.py +++ b/labelImg.py @@ -633,6 +633,9 @@ class MainWindow(QMainWindow, WindowMixin): action.setEnabled(True) def remLabel(self, shape): + if shape is None: + # print('rm empty label') + return item = self.shapesToItems[shape] self.labelList.takeItem(self.labelList.row(item)) del self.shapesToItems[shape] diff --git a/libs/shape.py b/libs/shape.py index 3bf5c1e8..fba1863b 100644 --- a/libs/shape.py +++ b/libs/shape.py @@ -58,7 +58,6 @@ class Shape(object): self.line_color = line_color def close(self): - assert len(self.points) > 2 self._closed = True def reachMaxPoints(self): @@ -163,7 +162,7 @@ class Shape(object): self._highlightIndex = None def copy(self): - shape = Shape("Copy of %s" % self.label) + shape = Shape("%s" % self.label) shape.points = [p for p in self.points] shape.fill = self.fill shape.selected = self.selected