コード例 #1
0
3.
"""

import os
import argparse

import ops
import path
import vm

# PROJECT = "enhance2"
PROJECT = "enhance_terminatorsunsets"
TRAINGVIDEO = "../../../terminator.mp4"
TRAINGVIDEO_FPS = "1/4"

path.init(PROJECT)


# def escalate(sizes=[256,512,1024]):
def escalate(init_size=32, sizes=[256, 512, 1024, 2048]):
    """Run the model multiple times with increasing resolution."""
    first = True
    for s in sizes:
        if first:
            ops.clean_filenames(path.rawC, rename='pic_%s')
            ops.crop_square_resize(path.rawC, path.C, init_size, init_size, s,
                                   s)
            first = False
        else:
            # copy output to input
            ops.output_as_input(path.test, path.tempC)
コード例 #2
0
                    help='duration')
parser.add_argument('--videoB_dur',
                    dest='videoB_dur',
                    default='00:00:10',
                    help='duration')
parser.add_argument('--videoA_fps',
                    dest='videoA_fps',
                    default='1',
                    help='at what rate to extract frames in Hz')
parser.add_argument('--videoB_fps',
                    dest='videoB_fps',
                    default='1',
                    help='at what rate to extract frames in Hz')
args = parser.parse_args()

path.init(args.dataset)

if args.cmd == 'extract':
    # delete_files(path.rawA)
    # video_extract(VIDEO_A, path.rawA, 24, size=args.size, intime="00:50:00", duration="00:04:40")

    delete_files(path.trainA)
    delete_files(path.trainB)
    video_extract(os.path.join('../../../../', args.videoA),
                  path.trainA,
                  args.videoA_fps,
                  size=args.size,
                  intime=args.videoA_in,
                  duration=args.videoA_dur)
    video_extract(os.path.join('../../../../', args.videoB),
                  path.trainB,
コード例 #3
0
    print "******************************************************************"
    print txt
    os.system(txt)



if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--gpu", action='store_true')
    args = parser.parse_args()

    INSTANCE = vm.RELAY_INSTANCE
    if args.gpu:
        INSTANCE = vm.GPU_INSTANCE


    for ds in datasets:
        path.init(ds)

        # mkdir datasets
        command('ssh %s "mkdir -p /home/stefan/git/%s/%s; mkdir -p /home/stefan/git/%s/%s;"'\
                % (INSTANCE, path.GIT_REPO_NAME, path.trainA, path.GIT_REPO_NAME, path.trainB))

        # trainA
        command("""rsync -rcPz -e ssh --delete %s/ %s:/home/stefan/git/%s/%s/""" \
                % (path.trainA, INSTANCE, path.GIT_REPO_NAME, path.trainA))

        # trainB
        command("""rsync -rcPz -e ssh --delete %s/ %s:/home/stefan/git/%s/%s/""" \
                % (path.trainB, INSTANCE, path.GIT_REPO_NAME, path.trainB))