Normalizes objs, but uses (a, b) instead of (minimum, maximum) value of objs, if supplied
(objs, a=None, b=None)
| 102 | |
| 103 | def process_predicitons(predictions, smoothening='none'): |
| 104 | def global_scaling(objs, a=None, b=None): |
| 105 | """Normalizes objs, but uses (a, b) instead of (minimum, maximum) value of objs, if supplied""" |
| 106 | normalized = [] |
| 107 | min_value = a if a is not None else min([obj.min() for obj in objs]) |
| 108 | max_value = b if b is not None else max([obj.max() for obj in objs]) |
| 109 | for obj in objs: |
| 110 | normalized += [(obj - min_value) / (max_value - min_value)] |
| 111 | return normalized |
| 112 | |
| 113 | print('Processing generated depthmaps') |
| 114 | # TODO: Detect cuts and process segments separately |
no outgoing calls
no test coverage detected