From 90717d6ee0ca3312946b01e4458b3e6c5f2b6b94 Mon Sep 17 00:00:00 2001 From: TwistedW <2359375192@qq.com> Date: Fri, 17 Jul 2020 18:28:25 +0800 Subject: [PATCH] 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 --- interactive_demo/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interactive_demo/app.py b/interactive_demo/app.py index 8d98968..ee9853f 100644 --- a/interactive_demo/app.py +++ b/interactive_demo/app.py @@ -208,6 +208,8 @@ def _save_mask_callback(self): mask = self.controller.result_mask if mask is None: return + if 0 < mask.max() < 256: + mask *= 255 // mask.max() filename = filedialog.asksaveasfilename(parent=self.master, initialfile='{}.png'.format(self.filename), filetypes=[ ("PNG image", "*.png"),