Beispiel #1
0
    # init colourama to filter ANSI chars in windows/linux
    init()

    # Change colour of usage to RED (help text)
    __doc__ = Fore.RED + __doc__ + Style.RESET_ALL

    # Use __doc__ string to parse cmd arguments
    arguments = docopt(__doc__, version="1.0")

    ################################################
    ## PARSING THE CLI STUFF AND MAIN PROGRAM FLOW #
    ################################################

    # Get the root and output dirs absolute paths
    root_path = files.abspath(arguments['ROOT'])
    out_path = files.abspath(arguments['OUTPUT'])
    N = int(arguments['N'])

    # For now, just print out settings and  all the images in the root.
    print(Fore.BLUE + "Settings passed: ")
    print("Root directory........ %s" % root_path)
    print("Output directory...... %s\n" % out_path)

    # Check that both directories exist
    if os.path.lexists(out_path) and os.path.lexists(root_path):
        pass
    else:
        print(Fore.RED +
              "Path not found, one of the directories does not exist.")
        print(Style.RESET_ALL)
Beispiel #2
0
    # init colourama to filter ANSI chars in windows/linux
    init()

    # Change colour of usage to RED (help text)
    __doc__ = Fore.RED + __doc__ + Style.RESET_ALL

    # Use __doc__ string to parse cmd arguments
    arguments = docopt(__doc__, version="1.0")

    ################################################
    ## PARSING THE CLI STUFF AND MAIN PROGRAM FLOW #
    ################################################

    # Get the root and output dirs absolute paths
    original_path = files.abspath(arguments['ORIGINALS'])
    result_path = files.abspath(arguments['RESULTS'])

    # For now, just print out settings and  all the images in the root.
    print(Fore.BLUE + "Settings passed: ")
    print("Original directory..... %s" % original_path)
    print("Results directory...... %s\n" % result_path)

    # Check that both directories exist
    if os.path.lexists(original_path) and os.path.lexists(result_path):
        pass
    else:
        print(Fore.RED +
              "Path not found, one of the directories does not exist.")
        print(Style.RESET_ALL)
        sys.exit(0)  # Use system's abort function
Beispiel #3
0
    pass

if __name__ == '__main__':
    # Change cwd to the current file's directory
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    # init colourama to filter ANSI chars in windows/linux
    init() 

    # Change colour of usage to RED (help text)
    __doc__ = Fore.RED + __doc__ + Style.RESET_ALL

    # Use __doc__ string to parse cmd arguments
    arguments = docopt(__doc__, version="1.0")

    eval_path = files.abspath(arguments['EVALUATION_DATA'])
    input_path = files.abspath(arguments['INPUT'])
    output_path = files.abspath(arguments['OUTPUT'])
    print(Fore.BLUE + "Evaluation directory..... %s" % eval_path)
    print(Fore.BLUE + "Image input directory.... %s" % input_path)
    print(Fore.BLUE + "Image output directory... %s" % output_path)

    if os.path.lexists(eval_path) and os.path.lexists(input_path):
        pass
    else:
        print(Fore.RED + "Path not found, evaluation/input directory does not exist.")
        print(Style.RESET_ALL)
        sys.exit(0) # Use system's abort function
    
    # Reset colour
    print(Style.RESET_ALL)
    # init colourama to filter ANSI chars in windows/linux
    init()

    # Change colour of usage to RED (help text)
    __doc__ = Fore.RED + __doc__ + Style.RESET_ALL

    # Use __doc__ string to parse cmd arguments
    arguments = docopt(__doc__, version="1.0")

    ################################################
    ## PARSING THE CLI STUFF AND MAIN PROGRAM FLOW #
    ################################################

    # Get the root and output dirs absolute paths
    root_path = files.abspath(arguments['ROOT'])
    out_path = files.abspath(arguments['OUTPUT'])
    stats_path = files.abspath(arguments['STATS'])
    hist_path = files.abspath(arguments['HIST'])

    # For now, just print out settings and  all the images in the root.
    print(Fore.BLUE + "Settings passed: ")
    print("Root directory........ %s" % root_path)
    print("Output directory...... %s\n" % out_path)
    print("Stats file directory........ %s" % stats_path)
    print("Histogram file directory...... %s\n" % hist_path)

    # Check that both directories exist
    if os.path.lexists(out_path) and os.path.lexists(root_path):
        pass
    else: