Skip to content

Add ten/five crop augmentation#110

Open
Junxi-Chen wants to merge 1 commit intov-iashin:masterfrom
Junxi-Chen:crop_augment
Open

Add ten/five crop augmentation#110
Junxi-Chen wants to merge 1 commit intov-iashin:masterfrom
Junxi-Chen:crop_augment

Conversation

@Junxi-Chen
Copy link
Copy Markdown

Add ten/five crop augmentation when extract the I3D features. Solve issue #92 #72 . And add save_option to the i3d.yaml file to save only reg features. Because I think that fps and timestamp features are really redundant. The shape of the rgb features imply timestamp.

Thank you for your great work. 🚀🚀

Copy link
Copy Markdown
Owner

@v-iashin v-iashin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your pull request. However, it should be significantly revised before merging.

I'd be more positive about it if:

  1. one pull request wouldn't implement two features: one for the ten crop, the other for the changes in disk writing
  2. I don't like that each crop is treated as a separate video (now each video creates 10/5 times more files. can't we implement crop as a batch dimension?
  3. the augs are applied only to RGB stream, not both.
  4. the augs are implemented for i3d but not other models.
  5. i am not happy that the classes/functions that are common for many models are being changed without reflecting on how logic for other features that depend on them changes

i appreciate the efforts but i am not convinced that it is enough

Comment thread models/i3d/extract_i3d.py
self.i3d_transforms = {
'rgb': torchvision.transforms.Compose([
TensorCenterCrop(self.central_crop_size),
aug_transform,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why we can't do it for the flow?

Comment thread models/i3d/extract_i3d.py


if self.aug_type is not None:
feats_dict = {stream: [[] for _ in range(self.num_crop)] for stream in self.streams}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why treat each crop as a separate tensor instead of a batch dimension: B, Crops, D --> B*Crops, D?

Comment thread models/transforms.py

def __call__(self, tensor: torch.FloatTensor) -> torch.FloatTensor:
def __call__(self, tensor):
if isinstance(tensor, tuple):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lost typing

Comment thread models/transforms.py

def __call__(self, tensor: torch.FloatTensor) -> torch.FloatTensor:
def __call__(self, tensor):
if isinstance(tensor, tuple):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lost typing

Comment thread utils/utils.py
print()

def make_path(output_root, video_path, output_key, ext):
def make_path(output_root, video_path, output_key, ext, idx=None):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't resort to this. it became incredibly redundant. we need to save all features in one file

return

for key, value in feats_dict.items():
if self.save_option == 'rgb_only':
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's wrong with the streams argument in i3d?

This was referenced May 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants