pytorch-video-recognition icon indicating copy to clipboard operation
pytorch-video-recognition copied to clipboard

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

Open HorusMaster opened this issue 6 years ago • 2 comments
trafficstars

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

HorusMaster avatar Aug 05 '19 01:08 HorusMaster

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

HuangZuShu avatar Nov 16 '20 12:11 HuangZuShu

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.

Cli98 avatar Dec 14 '20 02:12 Cli98