logging.info("# Downloading data #") logging.info("####################") downloader.download_zipfiles() logging.info("") if FLAGS.process_tiles: # Load products to be processed (always load from file to ensure modularity for the downloader and processor) queried_products_path = (data_dir / 'orders' / order_id).with_suffix('.pkl') products_df = pd.read_pickle(queried_products_path) logging.info("###################") logging.info("# Processing data #") logging.info("###################") processpipeliner = ProcessPipeliner(products_df=products_df, directory=data_dir) processpipeliner.process_products() # preprocessor = PreProcessor(products=products_df, directory=data_dir, overwrite_products=FLAGS.overwrite, # compress_gtiff=FLAGS.compress, delete_jp2_files=True) # preprocessor.preprocess_products() # # postprocessor = PostProcessor(products=products_df, directory=data_dir, # overwrite_products=FLAGS.overwrite, compress_gtiff=FLAGS.compress) # postprocessor.postprocess_products(ndvi=False, vrt=True, coreg=True) if __name__ == '__main__': define_flags() app.run(main)
"""Eval.""" import os import time from absl import app from absl import logging import config import network as builder import tf_util import waymo_loader import tensorflow.compat.v2 as tf tf.enable_v2_behavior() FLAGS = config.define_flags() _SUMMARY_TXT = 'validation_summary.txt' _MIN_SUMMARY_STEPS = 10 def steps_to_run(current_step, steps_per_epoch, steps_per_loop): """Calculates steps to run on device.""" if steps_per_loop <= 0: raise ValueError('steps_per_loop should be positive integer.') if steps_per_loop == 1: return steps_per_loop remainder_in_epoch = current_step % steps_per_epoch if remainder_in_epoch != 0: return min(steps_per_epoch - remainder_in_epoch, steps_per_loop) else: return steps_per_loop
tf.logging.set_verbosity(tf.logging.ERROR) import config import importlib from idas.utils.utils import Colors, safe_mkdir from data_interface.utils_acdc.prepare_dataset import * # ----------------------------------------------------------------------------------- # # test our model on ACDC test data EXPERIMENT = 'model_ours_full_acdc' DATASET_NAME = 'acdc' TEST_ROOT_DIR = '../DATA/ACDC_testing' OUT_DIR = './acdc_test_results' # ----------------------------------------------------------------------------------- # safe_mkdir(OUT_DIR) config.define_flags() # noinspection PyUnresolvedReferences FLAGS = tf.app.flags.FLAGS # ----------------------------------------------------------------------------------- # def parse_info_cfg(filename): """ Extracts information contained in the Info.cfg file given as input. :param filename: path/to/patient/folder/Info.cfg :return: values for: ed, es """ ed, es = None, None with open(filename, 'r') as f: for line in f: