Segment sky from an image array, returning continuous non-sky confidence in [0, 1].
(
image: np.ndarray,
skyseg_session,
target_h: int,
target_w: int,
)
| 199 | |
| 200 | |
| 201 | def segment_sky_from_array( |
| 202 | image: np.ndarray, |
| 203 | skyseg_session, |
| 204 | target_h: int, |
| 205 | target_w: int, |
| 206 | ) -> np.ndarray: |
| 207 | """Segment sky from an image array, returning continuous non-sky confidence in [0, 1].""" |
| 208 | image_rgb = _image_to_rgb_uint8(image) |
| 209 | image_bgr = cv2.cvtColor(image_rgb, cv2.COLOR_RGB2BGR) |
| 210 | result_map = run_skyseg(skyseg_session, _SKYSEG_INPUT_SIZE, image_bgr) |
| 211 | result_map = cv2.resize(result_map, (target_w, target_h), interpolation=cv2.INTER_LINEAR) |
| 212 | return _result_map_to_non_sky_conf(result_map) |
| 213 | |
| 214 | |
| 215 | def segment_sky_from_array_batch( |
nothing calls this directly
no test coverage detected