Skip to content

Commit

Permalink
Show if a file is annotated by check box
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Jul 20, 2018
1 parent 4d64f02 commit 366dd48
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,15 @@ def importDirImages(self, dirpath, load=True):
self.lastOpenDir = dirpath
self.filename = None
self.fileListWidget.clear()
for imgPath in self.scanAllImages(dirpath):
item = QtWidgets.QListWidgetItem(imgPath)
for filename in self.scanAllImages(dirpath):
label_file = os.path.splitext(filename)[0] + '.json'
item = QtWidgets.QListWidgetItem(filename)
item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable)
if QtCore.QFile.exists(label_file) and \
LabelFile.isLabelFile(label_file):
item.setCheckState(Qt.Checked)
else:
item.setCheckState(Qt.Unchecked)
self.fileListWidget.addItem(item)
self.openNextImg(load=load)

Expand Down

0 comments on commit 366dd48

Please sign in to comment.