Skip to content

Commit

Permalink
Improve description parsing by ensuring zone-shaped consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
healthonrails committed Nov 6, 2024
1 parent 0d5d1f9 commit 471256e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions annolid/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2438,9 +2438,9 @@ def loadPredictShapes(self, frame_number, filename):
self.loadLabels(self.labelFile.shapes)
caption = self.labelFile.get_caption()
if caption is not None:
# self.canvas.setCaption(caption)
if self.caption_widget is not None:
self.caption_widget.set_caption(caption)
if self.caption_widget is None:
self.openCaption()
self.caption_widget.set_caption(caption)
except Exception as e:
print(e)

Expand Down
4 changes: 3 additions & 1 deletion annolid/postprocessing/tracking_results_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def load_zone_json(self):
with open(self.zone_file, 'r') as f:
self.zone_data = json.load(f)
logger.info(f"Loading zones from {self.zone_file}")

self.zone_shapes = [zone_shape for zone_shape in self.zone_data['shapes']
if 'description' in zone_shape and 'zone' in zone_shape['description'].lower()
if 'description' in zone_shape and zone_shape['description'] and
'zone' in zone_shape['description'].lower()
or 'zone' in zone_shape['label'].lower()]
self.zone_time_dict = {shape['label']: 0 for shape in self.zone_shapes}

Expand Down

0 comments on commit 471256e

Please sign in to comment.