''' Author: Sarath KS Date: 21/07/2019 E-mail: [email protected] ''' import tensorflow as tf import numpy as np import cv2 import glob import os from configparser import SafeConfigParser as cnf print("Tensorflow version: {}".format(tf.__version__)) os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' config = cnf() config.read('config.ini') # Creating dependent folders for w in config.items('directories'): if not os.path.exists(w[-1]): os.makedirs(w[-1]) COLOR_IMG_DIR = os.path.join('.', config.get('directories', 'source_img_dir')) TARGET_GRAY_IMG_DIR = os.path.join( '.', config.get('directories', 'target_img_dir')) MODEL_DIR = os.path.join('.', config.get('directories', 'model')) class Autoencoder(object): '''
@author: anto """ __author__ = "Anto I Lonappan" __copyright__ = "Copyright 2017, MB-II analysis Project, Presidency University" __date__ = "14-Sep-2017" __version__ = "0.0" __email__ = "*****@*****.**" __status__ = "Completed" # PYTHON LIBRARIES import numpy as np import _pickle as pl from configparser import ConfigParser as cnf # CONFIGURATION conf = cnf() conf.read('abe.ini') output_dir = conf.get('live', 'cat_anl_out') last_program = conf.get('live', 'last_program') if not last_program == 'CatalogAnalyser_MPI.py': print(""" I found Last program that you have run was {} Before running this code please run CatalogAnalyser_MPI.py. Also see abe.ini """.format(last_program)) raise Exception('PreviousRunError') XH = 0.76 with open('%s/dataUpd.p' % output_dir, 'rb') as fr:
import os import glob as g import datetime as dt from numpy import arange from configparser import ConfigParser as cnf now = dt.datetime.now() day = now.day month = now.month year = now.year hour = now.hour minute = now.minute inpu = cnf() inpu.read('abe.ini') snapshot = inpu.get('inputs', 'snapshot') root = inpu.get('outputs', 'root_dir') no_of_cores = int(inpu.get('misc', 'no_of_cores')) if not os.path.isdir(snapshot): raise Exception('Snapshot not found!') files = g.glob(snapshot+'/snap*') if len(files) == 0: raise Exception('No files in Snpashot directory!') if len(files)%no_of_cores != 0: for pro in reversed(arange(1,no_of_cores+1,1)):