Convert vals in [0,1] to [0,255]
(vals_01)
| 256 | |
| 257 | |
| 258 | def to_255(vals_01): |
| 259 | '''Convert vals in [0,1] to [0,255]''' |
| 260 | try: |
| 261 | ret = [v*255 for v in vals_01] |
| 262 | if type(vals_01) is tuple: |
| 263 | return tuple(ret) |
| 264 | else: |
| 265 | return ret |
| 266 | except TypeError: |
| 267 | # Not iterable (single int or float) |
| 268 | return vals_01*255 |
| 269 | |
| 270 | |
| 271 | def ensure_uint255_and_resize_to_fit(img, out_max_shape, |
no outgoing calls
no test coverage detected