jfzhang95 / pytorch-video-recognition

PyTorch implemented C3D, R3D, R2Plus1D models for video activity recognition.
MIT License
1.16k stars 250 forks source link

When I open the folder there is more than 16 images. #33

Open HorusMaster opened 4 years ago

HorusMaster commented 4 years ago

clip_len (int): Determines how many frames are there in each clip. Defaults to 16. But when I open the folder of the preprocessed video I see more than 16 images, somentimes 32 or 40

HuangZuShu commented 3 years ago

I think “default to 16” refers to only crop 16 frame. From the following code , you may see it.

    def crop(self, buffer, clip_len, crop_size):
        # randomly select time index for temporal jittering
        time_index = np.random.randint(buffer.shape[0] - clip_len)

        # Randomly select start indices in order to crop the video
        height_index = np.random.randint(buffer.shape[1] - crop_size)
        width_index = np.random.randint(buffer.shape[2] - crop_size)

        # Crop and jitter the video using indexing. The spatial crop is performed on
        # the entire array, so each frame is cropped in the same location. The temporal
        # jitter takes place via the selection of consecutive frames
        buffer = buffer[time_index:time_index + clip_len,
                 height_index:height_index + crop_size,
                 width_index:width_index + crop_size, :]

        return buffer
Cli98 commented 3 years ago

clip_len (int): Determines how many frames are there in each clip. Defaults to 16. But when I open the folder of the preprocessed video I see more than 16 images, somentimes 32 or 40

No. What you discussed is the result in preprocessing. At that stage, cropping does not apply.