Skip to content

Commit

Permalink
fixed handling of empty data detections
Browse files Browse the repository at this point in the history
  • Loading branch information
rlav440 committed Mar 20, 2024
1 parent 5699c61 commit 5935945
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pyCamSet/calibration_targets/target_detections.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ def __add__(self, other:TargetDetection) -> TargetDetection:
f'Detection 1 names: {other.names}')
self._glomp_buffer()
other._glomp_buffer()
if self._data is None:
if other._data is None:
return self
return other
if other._data is None:
return self
if self._data.shape[0] == 0:
if other._data.shape[0] == 0:
shared_data = self._data
Expand Down Expand Up @@ -247,6 +253,7 @@ def add_detection(self, cam_name, im_num, detection: ImageDetection) -> None:
, axis=1)
self._update_buffer.append(observation)


def _glomp_buffer(self) -> None:
"""
Incorporates the update buffer before use.
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[metadata]
name = pyCamSet


version = 0.5.5
version = 0.5.6
author = Robin Laven
author_email = r.laven@auckland.ac.nz
description = Object oriented cameras for computer vision
Expand Down

0 comments on commit 5935945

Please sign in to comment.