KaiyangZhou / pytorch-vsumm-reinforce

Unsupervised video summarization with deep reinforcement learning (AAAI'18)
MIT License
472 stars 150 forks source link

How to test and summary my video? #58

Open darkdante2209 opened 4 years ago

darkdante2209 commented 4 years ago

Sir, I read your code and the issues but I coudn't find the way to summary my own video, please help me, thanks

SinDongHwan commented 4 years ago

Hi, @darkdante2209. If you want to summary yours video, you should have following data.

'features' : features of subampled frames in original video 'picks' : positions of subsampled frames in original video( default : 15 ) 'n_frames' : number of frames in original video 'fps' : frame per second of a video 'change_points' : 2D-array with shape (num_segments, 2), each row stores indices of a segment 'n_frame_per_seg' : 1D-array with shape (num_segments), indicates number of frames in each segment

if you use KTS, you can get change_points.

refer this code

Good Luck!!

darkdante2209 commented 4 years ago

So I just need to run that file generate_dataset.py to create file h5 from my video file? What is the python and pytorch version you used to run generate_dataset sir?

SinDongHwan commented 4 years ago

Hi, @darkdante2209.

this code is pytorch version. And maybe you use the python3.6 ver.

darkdante2209 commented 4 years ago

The problem is you using "weave" package in the project, weave only available with python2.7, but if I use python 2.7, I can't install torch version 1.4.0 and torchvision ver 0.5.0

SinDongHwan commented 4 years ago

i'm working, so i will try it after about 3 hours. ^^

twelcone commented 2 years ago

Hi @SinDongHwan Can you write again the code without using "weave" package please, I'm using python 3.6 and I can't run your code :'(

SinDongHwan commented 2 years ago

Hi, @twelcone If you're using python3, i think you should convert weave code to cython code. If you don't have a time enough, try to use python2.

twelcone commented 2 years ago

Hi, @SinDongHwan

I converted it, and I'm created my dataset, but can you help me to create user_summary plz, I only use the dataset for testing so I think I don't need gtscore, and when I run testing, the code error, which is said that I need user_summary. Can you help me please :( Tks so much for replying me

KeyError: "Unable to open object (object 'user_summary' doesn't exist)"

SinDongHwan commented 2 years ago

Hi, @twelcone. When test model, you don't need 'user_summary'. Could you tell me how to execute codes ? And show me your error trace log.

https://github.com/SinDongHwan/pytorch-vsumm-reinforce/blob/e3c3a6df8c15bbcf76af73efd29cf61673c57971/utils/generate_dataset.py#L137

twelcone commented 2 years ago

Hi, @SinDongHwan when testing the model, instead of using the orginal dataset (python main.py -d datasets/eccv16_dataset_summe_google_pool5.h5 -s datasets/summe_splits.json -m summe --gpu 0 --save-dir log/summe-split0 --split-id 0 --evaluate --resume log/summe-split0/model.epoch60.pth.tar --verbose --save-results)

I changed the eccv16_dataset to my custom dataset (python main.py -d datasets/custom-dataset.h5 -s datasets/summe_splits.json -m summe --gpu 0 --save-dir log/summe-split0 --split-id 0 --evaluate --resume log/summe-split0/model.epoch60.pth.tar --verbose --save-results)

And this is the error:

Traceback (most recent call last): File "main.py", line 208, in main() File "main.py", line 104, in main evaluate(model, dataset, test_keys, use_gpu) File "main.py", line 172, in evaluate seq = dataset[key]['features'][...] File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "C:\Users\vuquo\anaconda3\envs\dsn-reinforce\lib\site-packages\h5py_hl\group.py", line 264, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py\h5o.pyx", line 190, in h5py.h5o.open KeyError: "Unable to open object (object 'video_13' doesn't exist)"

I just want to use my own video only for testing and summary. Can you show me how to do it. I'm new in this so I don't know how to do it correctly.

SinDongHwan commented 2 years ago

Hi, @twelcone You can't test a your video in this repository. Just can train and evaluate. You're able to test a your video in my repository. refer this link https://github.com/SinDongHwan/pytorch-vsumm-reinforce/blob/e3c3a6df8c15bbcf76af73efd29cf61673c57971/video_summarization.py#L72

And i think differe between evaluation task and test task.

twelcone commented 2 years ago

Hi, @SinDongHwan

Tks very much for your response. Now I'm able to create my own summary video. Tks for helping me with my problem <3

SinDongHwan commented 2 years ago

Hi, @twelcone You're welcome! I think it is awesome for you to convert weave version to cython version.

Good Luck!

azadehashouri commented 2 years ago

Hi, @SinDongHwan

Tks very much for your response. Now I'm able to create my own summary video. Tks for helping me with my problem <3

Hi,@twelcone Could you help me with test this code on my own video? Thanks.

2uocAnh commented 5 months ago

So I just need to run that file generate_dataset.py to create file h5 from my video file? What is the python and pytorch version you used to run generate_dataset sir?

have you solved your issue ? I have the same problem too :<

2uocAnh commented 5 months ago

Hi, @SinDongHwan

Tks very much for your response. Now I'm able to create my own summary video. Tks for helping me with my problem <3

Can you help me :(, I have an error when run summary2video: KeyError: "Unable to open object (object 'machine_summary' doesn't exist)"

Thanks a lot <3