# Loop through data.
pbar = tqdm(total=len(data.data))
for video in data.data:

    # Get the path to the sequence for this video.
    path = os.path.join('data', 'sequences', video[1]+video[2] + '-' + str(seq_length) + \
        '-features')  # numpy will auto-append .npy

    # Check if we already have it.
    if os.path.isfile(path + '.npy'):
        pbar.update(1)
        continue

    # Get the frames for this video.
    # frames = data.get_frames_for_sample(video)
    frames = data.get_features_for_sample(video)
    print(video[2])
    # Now downsample to just the ones we need.
    frames = data.rescale_list(frames, seq_length)

    # frames1 = data.get_frames_for_sample(video)
    # frames1 = data.rescale_list(frames1, seq_length)

    frames1 = [w.replace('txt', 'jpg') for w in frames]
    # Now loop through and extract features to build the sequence.
    sequence = []
    for (i,j) in itertools.izip(frames,frames1):
        features=[]
        ifeatures=[]
        cfeatures=[]
        # print(i)