MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / _create_grayscale_image

Method _create_grayscale_image

utils/visualizer.py:1182–1191  ·  view source on GitHub ↗

Create a grayscale version of the original image. The colors in masked area, if given, will be kept.

(self, mask=None)

Source from the content-addressed store, hash-verified

1180 return tuple(res)
1181
1182 def _create_grayscale_image(self, mask=None):
1183 """
1184 Create a grayscale version of the original image.
1185 The colors in masked area, if given, will be kept.
1186 """
1187 img_bw = self.img.astype("f4").mean(axis=2)
1188 img_bw = np.stack([img_bw] * 3, axis=2)
1189 if mask is not None:
1190 img_bw[mask] = self.img[mask]
1191 return img_bw
1192
1193 def _change_color_brightness(self, color, brightness_factor):
1194 """

Callers 2

draw_panoptic_segMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected