Exemplo n.º 1
0
resultdir = './results/cows/'
if not (path.exists(resultdir)):
    os.mkdir(resultdir)
datestring = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
os.mkdir(resultdir + datestring)

# Saving parameter file
helper.print_params('./results/cows/' + datestring + '/PARAMETERS.txt',
                    experiment_parameters)

# Running the experiments
files = glob.glob('./data/cows/*mp4')
files.sort()
vids = []
for f_i, file in enumerate(files):
    cv, _ = helper.readvid(file, scale=(224, 224))
    vids.append(cv)
dpref = resultdir + datestring

fpref = dpref + '/' + 'cows'
print('Processing now:', fpref)
print()
vid_pairs = []
for V in vids:
    V_ = np.zeros((V.shape[0] - 1, 6, V.shape[2], V.shape[3]))
    V_[:, 0, :, :] = V[:-1, 0]
    V_[:, 1, :, :] = V[:-1, 1]
    V_[:, 2, :, :] = V[:-1, 2]
    V_[:, 3, :, :] = V[1:, 0]
    V_[:, 4, :, :] = V[1:, 1]
    V_[:, 5, :, :] = V[1:, 2]
Exemplo n.º 2
0
experiment_parameters['n_clayers'] = 5
experiment_parameters['kernel1_size'] = 8

# Setting up data folder
resultdir = './results/playing_incomplete/'
if not(path.exists(resultdir)):
    os.mkdir(resultdir)
datestring = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
os.mkdir(resultdir+datestring)

# Saving parameter file
helper.print_params('./results/playing_incomplete/'+datestring+'/PARAMETERS.txt',
                    experiment_parameters)

# Running the experiments
V, _ = helper.readvid('./data/playing_incomplete/playing_incomplete.avi')
M, _ = helper.readvid('./data/playing_incomplete/playing_mask.avi')
dpref = resultdir+datestring

fpref = dpref+'/'+'playing_incomplete'
print('Processing now:', fpref)
print()
vid_pairs = []
V_ = np.zeros((V.shape[0]-1, 6, V.shape[2], V.shape[3]))
V_[:, 0, :, :] = V[:-1, 0]
V_[:, 1, :, :] = V[:-1, 1]
V_[:, 2, :, :] = V[:-1, 2]
V_[:, 3, :, :] = V[1:, 0]
V_[:, 4, :, :] = V[1:, 1]
V_[:, 5, :, :] = V[1:, 2]
M_ = np.zeros((M.shape[0]-1, 2, M.shape[2], M.shape[3]))
Exemplo n.º 3
0
experiment_parameters['save_interval'] = 5
experiment_parameters['n_clayers'] = 5
experiment_parameters['kernel1_size'] = 8

# Setting up data folder
resultdir = './results/stgconv_data/'
if not (path.exists(resultdir)):
    os.mkdir(resultdir)
datestring = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
os.mkdir(resultdir + datestring)

# Running the experiments
files = glob.glob('./data/stgconv_data/*.avi')
files.sort()
for f_i, file in enumerate(files):
    V, fr = helper.readvid(file, scale=(128, 128))
    os.mkdir(resultdir + datestring + '/v' + str(f_i))
    dpref = resultdir + datestring + '/v' + str(f_i)
    fpref = dpref + '/vid' + str(f_i)
    print('Processing now:', fpref)
    print()
    V_ = np.zeros((V.shape[0] - 1, 6, V.shape[2], V.shape[3]))
    V_[:, 0, :, :] = V[:-1, 0]
    V_[:, 1, :, :] = V[:-1, 1]
    V_[:, 2, :, :] = V[:-1, 2]
    V_[:, 3, :, :] = V[1:, 0]
    V_[:, 4, :, :] = V[1:, 1]
    V_[:, 5, :, :] = V[1:, 2]

    experiment_parameters['fps'] = fr
    experiment_parameters['n_epochs'] = 62500 // V.shape[0]
Exemplo n.º 4
0
experiment_parameters['n_clayers'] = 5
experiment_parameters['kernel1_size'] = 4

# Setting up data folder
resultdir = './results/incomplete/'
if not (path.exists(resultdir)):
    os.mkdir(resultdir)
datestring = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
os.mkdir(resultdir + datestring)

# Saving parameter file
helper.print_params('./results/incomplete/' + datestring + '/PARAMETERS.txt',
                    experiment_parameters)

# Running the experiments
V, _ = helper.readvid('./data/incomplete/windmill_incomplete.avi')
M, _ = helper.readvid('./data/incomplete/windmill_mask.avi')
dpref = resultdir + datestring

fpref = dpref + '/' + 'incomplete'
print('Processing now:', fpref)
print()
vid_pairs = []
V_ = np.zeros((V.shape[0] - 1, 6, V.shape[2], V.shape[3]))
V_[:, 0, :, :] = V[:-1, 0]
V_[:, 1, :, :] = V[:-1, 1]
V_[:, 2, :, :] = V[:-1, 2]
V_[:, 3, :, :] = V[1:, 0]
V_[:, 4, :, :] = V[1:, 1]
V_[:, 5, :, :] = V[1:, 2]
M_ = np.zeros((M.shape[0] - 1, 2, M.shape[2], M.shape[3]))