I found Keras API that allows to add additional time dimension.
model = Sequential() # define CNN model model.add(TimeDistributed(Conv2D(...)) model.add(TimeDistributed(MaxPooling2D(...))) model.add(TimeDistributed(Flatten())) # define LSTM model model.add(LSTM(...)) model.add(Dense(...))
I thought that this is only something that allows to write shorter code because we don't need to use loop over images and extracting features. But I read somewhere that it is not the same as extracting features with a CNN, ad then passing the sequence to a separate RNN.
So what is the difference between these two solutions? What is better in what situations?