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

Use when the H and W are different ... #9

Open
lingblessing opened this issue Dec 25, 2021 · 10 comments
Open

Use when the H and W are different ... #9

lingblessing opened this issue Dec 25, 2021 · 10 comments

Comments

@lingblessing
Copy link

If I have different image H and W, can I still use DPT? What if I want to use pictures with different H and W?

@volgachen
Copy link
Collaborator

Yes, you can use it. Different H and W only mean that you will get a different amount of patches. It has no influence how the model processes the image.

I recommend you refer model for detection. The model file here can automatically handle pictures with different sizes.

model = dpt_tiny()
output = model(inputs)

@volgachen
Copy link
Collaborator

You can ignore the module argument img_size and patch_count in detection code. It exists just because I also use this code for fixed-resolution classification.

@lingblessing
Copy link
Author

How can I ignore img_size and patch_count, these two variables are used for model building.

@volgachen
Copy link
Collaborator

Yeah, but you may find that it actually has no influence on the model. I will update the code and remove them later.

@lingblessing
Copy link
Author

When will you update? Sorry to urge you, because I have been using DPT these days, and at the same time, I will continue to study how to get rid of the limitations of these two variables. But I still hope you update the code as soon as possible.

@volgachen
Copy link
Collaborator

I suggest that you can try set img_size=224 and patch_count=224/patch_size in spite of other contents. It will not influence final results. Update for code may need some days.

@lingblessing
Copy link
Author

Okay, I found it, thank you.

@lingblessing
Copy link
Author

from .box_coder import *
from .depatch_embed import Simple_DePatch

box_coder = pointwhCoder(*args, **kwargs)
my_module = Simple_DePatch(box_coder, *args, **kwargs)
At this time, is everything in my_module DPT or everything including VIT transformer?
In short, do I need to integrate the DeformablePatchTransformer class?

@volgachen
Copy link
Collaborator

from .box_coder import * from .depatch_embed import Simple_DePatch

box_coder = pointwhCoder(*args, **kwargs) my_module = Simple_DePatch(box_coder, *args, **kwargs) At this time, is everything in my_module DPT or everything including VIT transformer? In short, do I need to integrate the DeformablePatchTransformer class?

Yeah, you need to. In this way, my module is only a patch embedding module. If you want to use it with your other backbone model, you need to build the model by yourself

@lingblessing
Copy link
Author

May I ask which part of DETR did you embed DPT into? Because the accuracy didn't improve after I added it to DETR, I'm asking you. thanks.

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

2 participants