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

ask for the code of data preprocessing before I3d #21

Closed
marsplant opened this issue Jun 2, 2021 · 4 comments
Closed

ask for the code of data preprocessing before I3d #21

marsplant opened this issue Jun 2, 2021 · 4 comments

Comments

@marsplant
Copy link

thank you for your excellent work!

I saw people met the same problem of data preprocessing on the I3D feature extraction.

Can you share the code of data preprocessing before I3d ?

Can you specify exactly how you do the tenCrop on an image ?

thanks!

@tianyu0207
Copy link
Owner

thank you for your excellent work!

I saw people met the same problem of data preprocessing on the I3D feature extraction.

Can you share the code of data preprocessing before I3d ?

Can you specify exactly how you do the tenCrop on an image ?

thanks!

Below is my feature extraction setup.

mean = [114.75, 114.75, 114.75]
std = [57.375, 57.375, 57.375]

split == '10_crop_ucf':
transform = transforms.Compose([
gtransforms.GroupResize(256),
gtransforms.GroupTenCrop(224),
gtransforms.ten_crop_ToTensor(),
gtransforms.GroupNormalize_ten_crop(mean, std),
gtransforms.LoopPad(max_len),
])

class GroupTenCrop(object):
def init(self, size):
transform = torchvision.transforms.Compose([
torchvision.transforms.TenCrop(size),
torchvision.transforms.Lambda(lambda crops: torch.stack([torchvision.transforms.ToTensor()(crop) for crop in crops])),
])
self.worker = transform
def call(self, img_group):
return [self.worker(img) for img in img_group]

class ToTensor(object):
def init(self):
self.worker = lambda x: F.to_tensor(x) * 255
def call(self, img_group):
img_group = [self.worker(img) for img in img_group]
return torch.stack(img_group, 0)

@DungVo1507
Copy link

Hi @marsplant,
I am also looking for a way to extract i3d features on my dataset. I don't know if you have succeeded in extracting i3d features or not? If successful can you guide me?
Thank you so much!

@daviduarte
Copy link

Can you release the LoopPad part?

Thank you!

@zimengxueying
Copy link

Hi @marsplant, I am also looking for a way to extract i3d features on my dataset. I don't know if you have succeeded in extracting i3d features or not? If successful can you guide me? Thank you so much!

Sorry to bother you... Have ever solved the problem? If successful can you guide me?
Thank you so much!

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