Skip to content

Commit

Permalink
Add check for caption existence to ensure backward compatibility with…
Browse files Browse the repository at this point in the history
… label files.
  • Loading branch information
healthonrails committed Oct 17, 2024
1 parent ea46fc6 commit 47b3afe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion annolid/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion annolid/gui/label_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 47b3afe

Please sign in to comment.