ferreirafabio / video2tfrecord

Easily convert RGB video data (e.g. .avi) to the TensorFlow tfrecords file format for training e.g. a NN in TensorFlow. This implementation allows to limit the number of frames per video to be stored in the tfrecords.
MIT License
153 stars 37 forks source link

Add an option to convert and save grey scale videos. #2

Open ajinkyaT opened 6 years ago

ajinkyaT commented 6 years ago

Hi!

Can you add an feature to save grey scale videos? In some of the applications of deep learning it is really useful to convert videos to grey scale to reduce number of parameters.

Thank you!

ferreirafabio commented 6 years ago

Hi ajinkyaT, thank you for your feedback! Unfortunately, I'm currently a bit too busy to improve the package with the requested functionality but I'd like to invite you to implement it (preferably with additional test-case) and pull-request your update.

Once my schedule allows it, I will integrate it but at this point I can't promise this to happen any time soon.

qianglisinoeusa commented 3 years ago

Hi ajinkyaT,

In my view, you can extract frame and use np.concatenate((frame)*3, axis=-1) to convert the gray frame into 3 channels. I am writing a new video2tfrecord function that will consider adding a gray video into it. However, it should not be a problem when you convert 1 channel into 3 channels.

ferreirafabio commented 3 years ago

Great! Looking forward to it!