MCPcopy Create free account
hub / github.com/Robbyant/lingbot-map / segment_sky_from_array

Function segment_sky_from_array

demo_render/rgbd_render/data/sky.py:201–212  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

199
200
201def 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
215def segment_sky_from_array_batch(

Callers

nothing calls this directly

Calls 3

_image_to_rgb_uint8Function · 0.70
run_skysegFunction · 0.70

Tested by

no test coverage detected