def get_image_spec_from_nchannels(nchannels, config): imagelike = config.feature_sets[0].files[0] template_image = image.Image(RasterioImageSource(imagelike)) eff_shape = template_image.patched_shape(config.patchsize) + (nchannels, ) eff_bbox = template_image.patched_bbox(config.patchsize) crs = template_image.crs return eff_shape, eff_bbox, crs
def get_image_spec(model, config): # temp workaround, we should have an image spec to check against nchannels = len(model.get_predict_tags()) imagelike = config.feature_sets[0].files[0] template_image = image.Image(RasterioImageSource(imagelike)) eff_shape = template_image.patched_shape(config.patchsize) + (nchannels,) eff_bbox = template_image.patched_bbox(config.patchsize) crs = template_image.crs return eff_shape, eff_bbox, crs
def get_image_pixel_res(config): image_file = config.feature_sets[0].files[0] im = image.Image(RasterioImageSource(image_file)) return im.pixsize_x, im.pixsize_y
def get_image_bounds(config): image_file = config.feature_sets[0].files[0] im = image.Image(RasterioImageSource(image_file)) return im.bbox