labelImg.py
def newShape(self):
        """Pop-up and give focus to the label editor.

        position MUST be in global coordinates.
        """
        if not self.useDefaultLabelCheckbox.isChecked() or not self.defaultLabelTextLine.text():
            if len(self.labelHist) > 0:
                self.labelDialog = LabelDialog(
                    parent=self, listItem=self.labelHist)

            # Sync single class mode from PR#106
            if not self.recommenderMode.isChecked():
                if self.singleClassMode.isChecked() and self.lastLabel:
                    text = self.lastLabel
                else:
                    text = self.labelDialog.popUp(text=self.prevLabelText)
                    self.lastLabel = text
            elif self.canvas.shapes[-1].label is not None:
                text = self.canvas.shapes[-1].label
            else:
                text = 'unknown'
                self.lastLabel = text
        else:
            text = self.defaultLabelTextLine.text()

        # Add Chris
        self.diffcButton.setChecked(False)
        if text is not None:
            self.prevLabelText = text
            generate_color = QColor(0, 0, 0, 180)
            shape = self.canvas.setLastLabel(text, generate_color, generate_color)
            self.addLabel(shape)
            if self.beginner():  # Switch to edit mode.
                self.canvas.setEditing(True)
                self.actions.create.setEnabled(True)
            else:
                self.actions.editMode.setEnabled(True)
            self.setDirty()

            if text not in self.labelHist:
                self.labelHist.append(text)
        else:
            # self.canvas.undoLastLine()

            self.canvas.resetAllLines()
Pop-up and give focus to the label editor.

        position MUST be in global coordinates.
        
Pop-up and give focus to the label editor.
position MUST be in global coordinates.
Pop - up and give focus to the label editor . position MUST be in global coordinates .
def newShape(self):
        if not self.useDefaultLabelCheckbox.isChecked() or not self.defaultLabelTextLine.text():
            if len(self.labelHist) > 0:
                self.labelDialog = LabelDialog(
                    parent=self, listItem=self.labelHist)
            if not self.recommenderMode.isChecked():
                if self.singleClassMode.isChecked() and self.lastLabel:
                    text = self.lastLabel
                else:
                    text = self.labelDialog.popUp(text=self.prevLabelText)
                    self.lastLabel = text
            elif self.canvas.shapes[-1].label is not None:
                text = self.canvas.shapes[-1].label
            else:
                text = 'unknown'
                self.lastLabel = text
        else:
            text = self.defaultLabelTextLine.text()
        self.diffcButton.setChecked(False)
        if text is not None:
            self.prevLabelText = text
            generate_color = QColor(0, 0, 0, 180)
            shape = self.canvas.setLastLabel(text, generate_color, generate_color)
            self.addLabel(shape)
            if self.beginner():  
                self.canvas.setEditing(True)
                self.actions.create.setEnabled(True)
            else:
                self.actions.editMode.setEnabled(True)
            self.setDirty()
            if text not in self.labelHist:
                self.labelHist.append(text)
        else:
            self.canvas.resetAllLines()
def newShape ( self ) : if not self . useDefaultLabelCheckbox . isChecked ( ) or not self . defaultLabelTextLine . text ( ) : if len ( self . labelHist ) > 0 : self . labelDialog = LabelDialog ( parent = self , listItem = self . labelHist ) if not self . recommenderMode . isChecked ( ) : if self . singleClassMode . isChecked ( ) and self . lastLabel : text = self . lastLabel else : text = self . labelDialog . popUp ( text = self . prevLabelText ) self . lastLabel = text elif self . canvas . shapes [ - 1 ] . label is not None : text = self . canvas . shapes [ - 1 ] . label else : text = 'unknown' self . lastLabel = text else : text = self . defaultLabelTextLine . text ( ) self . diffcButton . setChecked ( False ) if text is not None : self . prevLabelText = text generate_color = QColor ( 0 , 0 , 0 , 180 ) shape = self . canvas . setLastLabel ( text , generate_color , generate_color ) self . addLabel ( shape ) if self . beginner ( ) : self . canvas . setEditing ( True ) self . actions . create . setEnabled ( True ) else : self . actions . editMode . setEnabled ( True ) self . setDirty ( ) if text not in self . labelHist : self . labelHist . append ( text ) else : self . canvas . resetAllLines ( )
Pop-up and give focus to the label editor.
Pop - up and give focus to the label editor .
"""Pop-up and give focus to the label editor.

        position MUST be in global coordinates.
        """ # Sync single class mode from PR#106 # Add Chris # Switch to edit mode. # self.canvas.undoLastLine()
self