Skip to content

Question about data transformer #21

Closed
@JyunYuLai

Description

@JyunYuLai

Hi,

Thank you for sharing the great work.
I have a question about the data transformer.

self.transforms_x = Compose([
RandomStretch(),
CenterCrop(instance_sz - 8),
RandomCrop(instance_sz - 2 * 8),
ToTensor()])

Why the size applied on the search image is "instance_sz - 2 * 8" which would be 255- 16 ??
Why not is just 255?
If you know the answer please share with me.
Thank you in advance.

Best Regards,
Lai

Activity

amoskalev

amoskalev commented on Sep 20, 2019

@amoskalev

The same question, original paper uses 255x255 resolution

huanglianghua

huanglianghua commented on Sep 21, 2019

@huanglianghua
Owner

"instance_sz - 2 * 8" is a random crop on 255x255 images, used in the training phase, thereby reducing the overfitting on training data.

amoskalev

amoskalev commented on Sep 21, 2019

@amoskalev

Is it okay to use random crop if for training we expect image to be centered on the object?

JyunYuLai

JyunYuLai commented on Sep 21, 2019

@JyunYuLai
Author

Hi,

Thank you for your reply.
For my understanding, the smaller input size is okay.
But we have to compute the corresponding embedding size and target size during training.
For example, the original paper input size is 255, so the embedding size would be 22x22.
And in the repo is 255-16, so the embedding size would be 20x20.
Am i right? Please correct me if there is any misunderstanding.

The other question is like @ferumchrome , random crop and center crop is not mentioned in the paper, this should be the features in this repo?
How about the performance with and without the augmentation?
Thank you in advance.

Best Regards,
Lai

huanglianghua

huanglianghua commented on Sep 23, 2019

@huanglianghua
Owner

@ferumchrome The offsets can be used to simulate the target's movement during test. (During test, the targets are not always stay at the center)

@JyunYuLai It does not matter so much that the embedding sizes in training and test are different. The AlexNet has no padding, so cropping on the image approximately has the same effect as cropping on the features (regardless of the differences caused by 3x3 max-poolings), as well as on the score map.

In effect, cropping a 239x239 image on a 255x255 one, is (approximately) the same as cropping a 15x15 score map on the 17x17 one.

Accept-AI

Accept-AI commented on Feb 23, 2020

@Accept-AI

请问z = self._crop(z, box_z, self.instance_sz)
x = self._crop(x, box_x, self.instance_sz) 这个_crop()是什么

huanglianghua

huanglianghua commented on Feb 23, 2020

@huanglianghua
Owner

@xzy123456611 The _crop method extracts a squared area centered at the box_z/box_x, with reasonable context. The side length of the output image is self.instance_sz.

Accept-AI

Accept-AI commented on Feb 24, 2020

@Accept-AI

@xzy123456611 The _crop method extracts a squared area centered at the box_z/box_x, with reasonable context. The side length of the output image is self.instance_sz.

谢谢您的回复

Accept-AI

Accept-AI commented on Feb 24, 2020

@Accept-AI

z = self._crop(z, box_z, self.instance_sz)
x = self._crop(x, box_x, self.instance_sz)您好,为什么两行的代码,第三个参数用的都是self.instance_sz呢??

huanglianghua

huanglianghua commented on Feb 24, 2020

@huanglianghua
Owner

We do this for further data augmentation. The transforms_z further crops image z around its center to size (127, 127).

Accept-AI

Accept-AI commented on Feb 24, 2020

@Accept-AI

We do this for further data augmentation. The transforms_z further crops image z around its center to size (127, 127).

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @huanglianghua@amoskalev@JyunYuLai@Accept-AI

        Issue actions

          Question about data transformer · Issue #21 · huanglianghua/siamfc-pytorch