kenshohara / video-classification-3d-cnn-pytorch

Video classification tools using 3D ResNet
MIT License
1.11k stars 260 forks source link

Indexing in generate_result_video.py #30

Open Newbeeyoung opened 6 years ago

Newbeeyoung commented 6 years ago

Hi,

Thanks a lot for the nice program.

I have went through the whole program and it worked well. However, i found that there may be some mistake of indexing in your code.

In generate_result_video.py:

       n_elements = min(unit, len(clips) - i)
        scores = np.array(clips[i]['scores'])
        for j in range(i, min(i + unit, len(clips))):
            scores += np.array(clips[i]['scores'])
        scores /= n_elements

Should this scores be set to 0 initially? and change clips[i] to clips[j] in the loop? Since you are averaging the scores during unit time.

Mohamad73 commented 6 years ago

Hello, can you please explain what the generate_result_video do? I ran it and it just duplicated the tested videos into another folder.

Newbeeyoung commented 6 years ago

It just labels video based on output.json. A rectangle label will be shown at the left upper corner in the result video. @Mohamad73

Mohamad73 commented 6 years ago

@Newbeeyoung Thank you!!!!!!!!!

lyuanzhang commented 5 years ago

Could you please explain how the generate_result_video file runs? I tried to run this file but failed, and my output.json file is empty. thanks!

XianyuFFF commented 5 years ago

Could you please explain how the generate_result_video file runs? I tried to run this file but failed, and my output.json file is empty. thanks!

Do you know how the generate_result_video file runs? thank you

shadsakib commented 4 years ago

Did you get your answer? I'm having some trouble running generate_result_video.py.

Some of the errors I get:

1. 'rm' is not recognized as an internal or external command,
2. ../videos\: No such file or directory
3. ValueError: could not convert string to float: 'er'
87nohigher commented 3 years ago

I also got the error KeyError: 'scores' How to fix it?