def main(args): bbox = get_chip_bbox(args.chip_x, args.chip_y, args.chip_size) bbox_src = get_chip_bbox(args.src_image_x, args.src_image_y, args.src_image_size) cdl_chip = get_cdl_chip(args.ground_truth_file, bbox) cdl_chip, cat_dict = transform_cdl(cdl_chip) if args.saved_tbchips_dir is None: tb_chips = get_hls_chips(args.hls_dir, bbox_src, bbox) else: tb_chips = load_tb_chips(args.saved_tbchips_dir, bbox_src, bbox) if args.make_figure: make_figure(args.output_dir, cdl_chip, cat_dict, tb_chips)
def _get_tb_chips(self): src_bbox = get_chip_bbox(self._src_image_x, self._src_image_y, self._src_image_size) self._tb_chips = load_tb_chips(self._data_dir, src_bbox) # TODO load_tb_chips does virtually exactly what the version here does, # just loads the npy file directly. Doesn't create it self._N = self._tb_chips.shape[2] * self._tb_chips.shape[3]
def main(args): bbox = get_chip_bbox(args.image_x, args.image_y, args.image_size) if not args.tb_chips_only: make_and_save_hls(args.output_supdir, args.hls_dir, bbox) make_and_save_cdl(args.output_supdir, args.ground_truth_file, bbox) make_and_save_tbchips(pj(args.output_supdir, "hls"), bbox) print("Done, files written to %s" % (args.output_supdir))
def main(args): bbox = get_chip_bbox(args.chip_x, args.chip_y, args.chip_size) hls_by_band = get_hls_subregions_by_band(args.band, args.hls_dir, bbox) hls_by_time = get_hls_subregions_by_time(args.timepoint, args.hls_dir, bbox) cdl_subregion = get_cdl_subregion(args.ground_truth_file, bbox) make_cat_hist(cdl_subregion) make_figure(hls_by_band, hls_by_time, cdl_subregion, args.band, args.timepoint)
def main(args): for subdir in g_region_subdirs: input_dir = pj(args.input_supdir, subdir) output_dir = pj(args.output_supdir, subdir) if pe(output_dir): shutil.rmtree(output_dir) os.makedirs(output_dir) gt_file = pj(args.ground_truth_dir, cdl_file) # TODO select cdl file based on region for i in range(3): # TODO xstart = i*g_chip_size for j in range(3): # TODO ystart = j*g_chip_size bbox = get_chip_bbox(xstart, ystart, g_chip_size) make_and_save_hls(output_dir, args.hls_dir, bbox) make_and_save_cdl(output_dir, args.ground_truth_file, bbox) make_and_save_tbchips(output_dir, bbox)
def main(args): ground_truth_dir = pj(args.input_supdir, "ground_truth") for subdir in g_region_subdirs: input_dir = pj(args.input_supdir, subdir) output_dir = pj(args.output_supdir, subdir) if pe(output_dir): shutil.rmtree(output_dir) os.makedirs(output_dir) cdl_file_name = g_cdl_file_names[subdir] gt_file = pj(ground_truth_dir, cdl_file_name) hls_dir = pj(args.input_supdir, subdir) for i in range(3): # TODO xstart = i * g_chip_size for j in range(3): # TODO ystart = j * g_chip_size bbox = get_chip_bbox(xstart, ystart, g_chip_size) make_and_save_hls(output_dir, hls_dir, bbox) make_and_save_cdl(output_dir, gt_file, bbox) make_and_save_tbchips(subdir, pj(output_dir, "hls"), bbox)