Skip to content

Commit

Permalink
Automatic masks range selection for better visualization (#20)
Browse files Browse the repository at this point in the history
* Update app.py

The range of the mask needs to be changed.

* Automatic masks range selection for better visualization

Co-authored-by: Konstantin Sofiiuk <[email protected]>
  • Loading branch information
TwistedW and ksofiyuk authored Jul 17, 2020
1 parent c3f5790 commit 90717d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions interactive_demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 90717d6

Please sign in to comment.