MCPcopy Create free account
hub / github.com/apple/ml-4m / get_bbox

Method get_bbox

fourm/data/modality_transforms.py:391–396  ·  view source on GitHub ↗

Gets bounding box of the given instance

(self, instance)

Source from the content-addressed store, hash-verified

389 self.bbox_area_threshold = bbox_area_threshold
390
391 def get_bbox(self, instance):
392 """ Gets bounding box of the given instance
393 """
394 min_h, max_h = instance[:,:,1].min(), instance[:,:,1].max()
395 min_w, max_w = instance[:,:,0].min(), instance[:,:,0].max()
396 return [min_h, min_w, max_h, max_w]
397
398 def extend_instance_points(self, instance, border_fn):
399 """ Given an instance and a border function `border_fn`, extends the instance points with crossing points between the instance and

Callers 2

remove_tiny_instancesMethod · 0.95
get_binary_masksMethod · 0.95

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected