import tensorflow as tf

    if a.operation == "edges" and a.crop:
        try:
            if not tf.io.gfile.exists(a.crop_dir):
                tf.io.gfile.makedirs(a.crop_dir)
        except Exception as e:
            raise Exception("invalid crop_dir: {:s}".format(e))

    src_paths = []
    dst_paths = []

    skipped = 0
    for src_path in im.find(a.input_dir):
        name, _ = os.path.splitext(os.path.basename(src_path))
        dst_path = os.path.join(a.output_dir, name + ".png")
        if tf.io.gfile.exists(dst_path):
            skipped += 1
        else:
            src_paths.append(src_path)
            dst_paths.append(dst_path)
    
    print("skipping %d files that already exist" % skipped)
            
    global total
    total = len(src_paths)
    
    print("processing %d files" % total)

    global start
