MCPcopy
hub / github.com/xingyizhou/CenterNet / add_blend_img

Method add_blend_img

src/lib/utils/debugger.py:86–96  ·  view source on GitHub ↗
(self, back, fore, img_id='blend', trans=0.7)

Source from the content-addressed store, hash-verified

84 cv2.waitKey()
85
86 def add_blend_img(self, back, fore, img_id='blend', trans=0.7):
87 if self.theme == 'white':
88 fore = 255 - fore
89 if fore.shape[0] != back.shape[0] or fore.shape[0] != back.shape[1]:
90 fore = cv2.resize(fore, (back.shape[1], back.shape[0]))
91 if len(fore.shape) == 2:
92 fore = fore.reshape(fore.shape[0], fore.shape[1], 1)
93 self.imgs[img_id] = (back * (1. - trans) + fore * trans)
94 self.imgs[img_id][self.imgs[img_id] > 255] = 255
95 self.imgs[img_id][self.imgs[img_id] < 0] = 0
96 self.imgs[img_id] = self.imgs[img_id].astype(np.uint8).copy()
97
98 ''&#x27;
99 # slow version

Callers 9

compose_vis_addMethod · 0.95
debugMethod · 0.95
debugMethod · 0.95
debugMethod · 0.95
debugMethod · 0.95
debugMethod · 0.80
debugMethod · 0.80
debugMethod · 0.80
debugMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected