Skip to content

Commit

Permalink
Merge 0e70aff into 3af7fed
Browse files Browse the repository at this point in the history
  • Loading branch information
nixsui authored Mar 21, 2023
2 parents 3af7fed + 0e70aff commit c0d1d4c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mmpose/visualization/simcc_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def draw_instance_xy_heatmap(self,
x, y = self.draw_1d_heatmaps(i['x']), self.draw_1d_heatmaps(i['y'])
maps['x'].append(x)
maps['y'].append(y)
white = self.creat_blank(blank_size)
white = self.creat_blank(blank_size, K)
map2d = self.draw_2d_heatmaps(heatmap2d)
if mix:
map2d = cv.addWeighted(overlaid_image, 1 - weight, map2d, weight,
Expand Down Expand Up @@ -78,9 +78,16 @@ def draw_1d_heatmaps(self, heatmap_1d):
single_map = cv.applyColorMap(cv_img, cv.COLORMAP_JET)
return single_map

def creat_blank(self, size: Union[list, tuple]):
def creat_blank(self,
size: Union[list, tuple],
K: int = 20,
interval: int = 10):
"""Create the background."""
blank = np.zeros((size[0] * 2, size[1] * 2, 3), np.uint8)
blank_height = int(
max(size[0] * 2, size[0] * 1.1 + (K + 1) * (15 + interval)))
blank_width = int(
max(size[1] * 2, size[1] * 1.1 + (K + 1) * (15 + interval)))
blank = np.zeros((blank_height, blank_width, 3), np.uint8)
blank.fill(255)
return blank

Expand Down

0 comments on commit c0d1d4c

Please sign in to comment.