Skip to content

Commit

Permalink
Fixed Pixel Link interp file API issues (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoff authored and nmanovic committed Jul 3, 2019
1 parent b1890cd commit 08d7d8c
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@


class PixelLinkDecoder():
def __init__(self, height, width):
self.image_height = height
self.image_width = width
def __init__(self):
four_neighbours = False
if four_neighbours:
self._get_neighbours = self._get_neighbours_4
Expand All @@ -14,7 +12,9 @@ def __init__(self, height, width):
self.pixel_conf_threshold = 0.8
self.link_conf_threshold = 0.8

def decode(self, detections: dict):
def decode(self, height, width, detections: dict):
self.image_height = height
self.image_width = width
self.pixel_scores = self._set_pixel_scores(detections['pixel_cls/add_2'])
self.link_scores = self._set_link_scores(detections['pixel_link/add_2'])

Expand Down Expand Up @@ -131,7 +131,6 @@ def _get_neighbours_4(self, x, y):
return [i for i in tmp if i[1] >= 0 and i[1] < w and i[2] >= 0 and i[2] < h]

def _mask_to_bboxes(self, min_area=300, min_height=10):
image_h, image_w = self.image_shape
self.bboxes = []
max_bbox_idx = self.mask.max()
mask_tmp = cv2.resize(self.mask, (self.image_width, self.image_height), interpolation=cv2.INTER_NEAREST)
Expand Down

0 comments on commit 08d7d8c

Please sign in to comment.