Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I watch the videos result? #2

Open
Ayelets opened this issue Apr 18, 2019 · 5 comments
Open

How can I watch the videos result? #2

Ayelets opened this issue Apr 18, 2019 · 5 comments

Comments

@Ayelets
Copy link

Ayelets commented Apr 18, 2019

and also how can i use the model for summarize new videos?
many thanks

@ok1zjf
Copy link
Owner

ok1zjf commented Apr 23, 2019

Hi Ayelets,

To summarize your own video you need to first extract the video frames as images and generate change points (cps) with the KTS method.

def cpd_auto(K, ncp, vmax, desc_rate=1, **kwargs):

Then subsample the video sequence to 2fps and for each frame extract CNN features (1024 dim from the pool5 layer) with the GoogLeNet trained on ImageNet. Features for the entire video sequence are then provided as the input to the model.

To produce the video summarization, first use the model to generate frame importance scores y

VASNet/main.py

Line 294 in c378753

y, att_vec = self.model(seq, seq.shape[1])

and then generate keyshot summarization by calling

VASNet/main.py

Line 326 in c378753

machine_summary = generate_summary(probs, cps, num_frames, nfps, positions)

The machines_summary is a binary array indicating which video frame is a part of the summary. You can
use this information to create the summarized video with your favourite image/video processing toolkit,
such as OpenCV or moviepy. I hope this helps.

Kind Regards
Jiri

@wjb123
Copy link

wjb123 commented May 31, 2019

@ok1zjf how to use KTS to generate change points ? I use the official KTS code and employ CNN feature for each frame, but get same number of segments for every video. Is there any problem?

@BarCodeReader
Copy link

Hi Ayelets,

To summarize your own video you need to first extract the video frames as images and generate change points (cps) with the KTS method.

def cpd_auto(K, ncp, vmax, desc_rate=1, **kwargs):

Then subsample the video sequence to 2fps and for each frame extract CNN features (1024 dim from the pool5 layer) with the GoogLeNet trained on ImageNet. Features for the entire video sequence are then provided as the input to the model.
To produce the video summarization, first use the model to generate frame importance scores y

VASNet/main.py

Line 294 in c378753

y, att_vec = self.model(seq, seq.shape[1])

and then generate keyshot summarization by calling

VASNet/main.py

Line 326 in c378753

machine_summary = generate_summary(probs, cps, num_frames, nfps, positions)

The machines_summary is a binary array indicating which video frame is a part of the summary. You can
use this information to create the summarized video with your favourite image/video processing toolkit,
such as OpenCV or moviepy. I hope this helps.
Kind Regards
Jiri

i think we need to input GoogLeNet feature map into VASNet to generate frame score first, then feed in the score (1 dimensional vector) into KTS to do segmentation???

@ok1zjf
Copy link
Owner

ok1zjf commented Sep 16, 2019

Yes, you need to extract the video frames as images (e.g. jpg) and then generate the change points with KTS. The input to the KTS are indeed the GoogLeNet features.
Best
Jiri

@AdithyaSireesh
Copy link

Then subsample the video sequence to 2fps and for each frame extract CNN features (1024 dim from the pool5 layer) with the GoogLeNet trained on ImageNet. Features for the entire video sequence are then provided as the input to the model

Hi,

for the probabilities parameter in the generate_summary function, are we meant to input the probabilities for subsampled frames, or the whole video?

Thanks,
Adi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants