<jupyter_start><jupyter_text>Creating Sequences Looks to be ~ 12 seconds per video ~24 minutes for 120 videos, ~6.6 hrs for entire 1980 videos<jupyter_code># ---- RUN THE FOLLOWING CELLS TO GENERATE .NPY SEQ FOR ALL VIDEOS IN DATASET ----- # 
#      SEQUENCES THAT ALREADY EXIST WILL BE SKIPPED

seq_length = 16
dataset = DataSet(cnn_model)
dataset.data
tic = time.time()

for ind, sample in enumerate(dataset.data):
    
    path = os.path.join('data', 'sequences', sample[1], sample[2] + '-' + str(seq_length) + \
        '-features.npy')
    
    if os.path.isfile(path):
        print("Sequence: {} already exists".format(ind))
    else:
        print("Generating and saving sequence: {}".format(ind))
        sequence = dataset.extract_seq_features(sample)

print("Time Elapsed: {}".format(time.time() - tic))

# NOTE: The folders in `VIDEO_RGB` must be consolidated into the following folders in order for the data
# to retrieved properly according to the data_file.csv
# - backhand, bvolley, forehand, fvolley, service, smash
# OTHERWISE YOU WILL GET EMPTY SEQUENCES THAT CANNOT BE TRAINED ON<jupyter_output>Sequence: 0 already exists
Sequence: 1 already exists
Sequence: 2 already exists
Sequence: 3 already exists
Sequence: 4 already exists
Sequence: 5 already exists
Generating and saving sequence: 6
data/sequences/backhand/p53_backhand_s2-16-features
16
(2048,)
Generating and saving sequence: 7
data/sequences/backhand/p28_backhand_s2-16-features
16
(2048,)
Generating and saving sequence: 8
data/sequences/backhand/p12_backhand_s1-16-features
16
(2048,)
Generating and saving sequence: 9
data/sequences/backhand/p12_backhand_s2-16-features
16
(2048,)
Generating and saving sequence: 10
data/sequences/backhand/p18_backhand_s2-16-features
16
(2048,)
Generating and saving sequence: 11
data/sequences/backhand/p42_backhand_s3-16-features
16
(2048,)
Generating and saving sequence: 12
data/sequences/backhand/p26_backhand_s2-16-features
16
(2048,)
Generating and saving sequence: 13
data/sequences/backhand/p47_backhand_s1-16-features
16
(2048,)
Generating and saving sequence: 14
data/sequences/backhand[...]<jupyter_text>Sanity Check on Generated Sequences<jupyter_code>path = os.path.join('data', 'sequences', 'backhand', 'p36_backhand_s3-16-features.npy')

sequence = np.load(path)
sequence<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10449678800856531, 'fraction_numerical': 0.055674518201284794, 'mean_word_length': 4.974424552429667, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '173173', 'license': 'MIT', 'n_tokens_mistral': 881, 'n_tokens_neox': 767, 'n_words': 222, 'path': 'lrcnn/extract_and_save_sequences.ipynb', 'repo_name': 'Moogun/tennis_action_recognition', 'size': '2335'}