geowatch.tasks.depth.predict module¶
- geowatch.tasks.depth.predict.run_inference(image, model, device=0)[source]¶
Example
>>> from geowatch.tasks.depth.predict import * # NOQA >>> import kwimage >>> import kwarray >>> src = kwimage.ensure_float01(kwimage.grab_test_image(dsize=(512, 512))) >>> src = kwimage.Polygon.random(rng=None).scale(src.shape[0]).fill(src.copy(), np.nan) >>> model = fake_model >>> image = src * 255 >>> device = 'cpu' >>> result = run_inference(image, model, device=device) >>> # xdoctest: +REQUIRES(--show) >>> import kwplot >>> kwplot.autompl() >>> kwplot.imshow(src, pnum=(1, 2, 1), doclf=True) >>> kwplot.imshow(result, pnum=(1, 2, 2))