(img, mode)
| 91 | |
| 92 | |
| 93 | def _to_normalized_image(img, mode): |
| 94 | img = np.asarray(img) |
| 95 | assert img.ndim == 4 |
| 96 | return_img = [] |
| 97 | for single_img in img: |
| 98 | if single_img.shape[-1] == 2: |
| 99 | # treat 2 channels image as optical flow |
| 100 | return_img.append(_flow_to_image(img, mode)) |
| 101 | single_img = np.clip(single_img, 0, 255) |
| 102 | return_img.append(array_to_img(single_img, mode)) |
| 103 | return return_img |
| 104 | |
| 105 | |
| 106 | def _color_wheel(): |
no test coverage detected