diff --git a/annolid/gui/app.py b/annolid/gui/app.py index 56285be..6c90eee 100644 --- a/annolid/gui/app.py +++ b/annolid/gui/app.py @@ -2323,7 +2323,8 @@ def loadPredictShapes(self, frame_number, filename): if self.labelFile: self.loadLabels(self.labelFile.shapes) caption = self.labelFile.get_caption() - self.canvas.setCaption(caption) + if caption is not None: + self.canvas.setCaption(caption) except Exception as e: print(e) diff --git a/annolid/gui/label_file.py b/annolid/gui/label_file.py index ed78c59..adef63b 100644 --- a/annolid/gui/label_file.py +++ b/annolid/gui/label_file.py @@ -97,7 +97,7 @@ def load(self, filename): imagePath = None caption = None - if data['caption'] is not None: + if 'caption' in data and data['caption'] is not None: caption = data['caption'] if data["imageData"] is not None: