harvitronix / five-video-classification-methods

Code that accompanies my blog post outlining five video classification methods in Keras and TensorFlow
https://medium.com/@harvitronix/five-video-classification-methods-implemented-in-keras-and-tensorflow-99cad29cc0b5
MIT License
1.17k stars 479 forks source link

Make the seq_length large? #67

Closed guoxiaolu closed 6 years ago

guoxiaolu commented 6 years ago

Brilliant job, I have noticed that when extract_feature, the seq_length is given as 40. Besides, the min frame number is about 50 in UCF dataset. So, it is reasonable to set that value lower than 50.

In line 228, of 'data.py', 'assert len(input_list) >= size', that means seq_length larger than 50 is not permitted although it is useful for final acc.

Do you know the normal method of how to set a large seq_length larger than the frame number? Set the all zero features to the end of the sequence?

harvitronix commented 6 years ago

@guoxiaolu I think what you'll want to do is essentially what you said. Initialize the seq_length to zeros, and then set your frames at the start or end, or simply pad your sequence with however many spaces you need to create arrays of equal length.

Take a look at Kera's pad_sequences method: https://keras.io/preprocessing/sequence/

guoxiaolu commented 6 years ago

Thank you very much, it is what I want to know.

Ido-PX commented 5 years ago

@guoxiaolu did you end up padding empty frames? did it improve your accuracy?