I'm trying to implement an LRCN/C(LSTM)RNN to classify emotions in videos. My dataset structure is split in two folders - "train_set" and "valid_set". When you open, either of them, you can find 3 folders, "positive", "negative" and "surprise". Lastly, each of these 3 folders has video-folders, each of which is a collection of frames of a video in .jpg. Videos have different length, hence a video-folder can have 200 frames, the one next to it 1200, 700...! To load the dataset I am using flow_from_directory. Here, I need a few clarifications:
- Will in my case
flow_from_directoryload the videos 1 by 1, sequentially? Their frames? - If I load into batches, does
flow_from_directorytake a batch based on the sequential ordering of the images in a video? - If I have video_1 folder of 5 images and video_2 folder of 3 videos, and a batch size of 7, will
flow_from_directoryend up selecting two batches of 5 and 3 videos or it will overlap the videos, taking all 5 images from the first folder + 2 of the second? Will it mix my videos? - Is the dataset loading thread-safe? Worker one fetches video frames sequentially from folder 1, worker 2 from folder 2 etc... or each worker can takes frames from anywhere and any folder, which can spoil my sequential reading?
- If I enable
shuffle, will it shuffle the order in which it would read the video folders or it will start fetching frames in random order from random folders? - What does
TimeDisributedlayer do as from the documentation I cannot really imagine? What if I apply it to a CNN's dense layer or to each layer of a CNN?