Skip to content

Commit

Permalink
Update volume calculations.
Browse files Browse the repository at this point in the history
  • Loading branch information
We-Gold committed Aug 7, 2024
1 parent 4358ebc commit b73063a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions python/ouroboros/helpers/bounding_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,7 @@ def to_empty_volume(self, dtype=np.float32, num_channels=None):
return np.zeros(shape, dtype=dtype)

def calculate_volume(self):
return (
(self.x_max - self.x_min)
* (self.y_max - self.y_min)
* (self.z_max - self.z_min)
)
return np.prod(self.get_shape())

def should_be_divided(self, utilized_volume):
return utilized_volume < (1 - DEFAULT_SPLIT_THRESHOLD) * self.calculate_volume()
Expand Down
2 changes: 1 addition & 1 deletion python/test/helpers/test_bounding_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_bounding_box_calculate_volume():
rect = np.array([[0, 0, 0], [1, 1, 1]])
bbox = BoundingBox(rect)
volume = bbox.calculate_volume()
assert volume == 1
assert volume == 8


def test_to_empty_volume():
Expand Down

0 comments on commit b73063a

Please sign in to comment.