Skip to content

Commit 90717d6

Browse files
TwistedWksofiyuk
andauthored
Automatic masks range selection for better visualization (#20)
* Update app.py The range of the mask needs to be changed. * Automatic masks range selection for better visualization Co-authored-by: Konstantin Sofiiuk <sofiyuk@gmail.com>
1 parent c3f5790 commit 90717d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

interactive_demo/app.py

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ def _save_mask_callback(self):
208208
mask = self.controller.result_mask
209209
if mask is None:
210210
return
211+
if 0 < mask.max() < 256:
212+
mask *= 255 // mask.max()
211213

212214
filename = filedialog.asksaveasfilename(parent=self.master, initialfile='{}.png'.format(self.filename), filetypes=[
213215
("PNG image", "*.png"),

0 commit comments

Comments
 (0)