IDEA-Research / DAB-DETR

[ICLR 2022] Official implementation of the paper "DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR"
Apache License 2.0
501 stars 86 forks source link

visualizing results #29

Closed syssj1002 closed 2 years ago

syssj1002 commented 2 years ago

Thanks for your great work. After testing the code, how can I print the image results with bounding box? Is there any command or code?

yang-0201 commented 2 years ago

I want to know too!!

lebionick commented 2 years ago

i found plot_dual_img function in the code, but struggling with usage of it (no example in code at all). So I am wondering too

YooWang commented 2 years ago

I also didn't find a visualization of outputting a single image, but I referenced DETR's visualization code, which can then be used directly here.

SaifeiYan commented 2 years ago

can you send the your code to me?thanks a lot!

SaifeiYan commented 2 years ago

I also didn't find a visualization of outputting a single image, but I referenced DETR's visualization code, which can then be used directly here. Are you using DAB-Deformable-DETR, can you send me the reasoning visualization file?

QiqLiang commented 2 years ago

I also want to know! Somebody helps!

SlongLiu commented 2 years ago

Hello everyone, I provide a note for a demo of inference and visualization in https://github.com/IDEA-opensource/DAB-DETR/blob/main/inference_and_visualize.ipynb. Hope the file is helpful to you. Thanks for your suggestions.

SaifeiYan commented 2 years ago

Hello everyone, I provide a note for a demo of inference and visualization in https://github.com/IDEA-opensource/DAB-DETR/blob/main/inference_and_visualize.ipynb. Hope the file is helpful to you. Thanks for your suggestions.

Hello ,when I use your inference code, when I get to this line of code:

"output = model(image[None]) output = postprocessors['bbox'](output, torch.Tensor([[1.0, 1.0]]))[0]" image

image

and then, how should I solve this problem, please tell me more , Thanks a lot!

SlongLiu commented 2 years ago

Hello everyone, I provide a note for a demo of inference and visualization in https://github.com/IDEA-opensource/DAB-DETR/blob/main/inference_and_visualize.ipynb. Hope the file is helpful to you. Thanks for your suggestions.

Hello ,when I use your inference code, when I get to this line of code:

"output = model(image[None]) output = postprocessors['bbox'](output, torch.Tensor([[1.0, 1.0]]))[0]" image

image

and then, how should I solve this problem, please tell me more , Thanks a lot!

Our code is running on CPUs, whereas the dab_deformable_detr supports GPU only. You can send images and models to GPU before inference. A simple way to modify it:

model = model.cuda()
image = image.cuda()
output = model(image[None])
SaifeiYan commented 2 years ago

Hello everyone, I provide a note for a demo of inference and visualization in https://github.com/IDEA-opensource/DAB-DETR/blob/main/inference_and_visualize.ipynb. Hope the file is helpful to you. Thanks for your suggestions.

Hello ,when I use your inference code, when I get to this line of code: "output = model(image[None]) output = postprocessors['bbox'](output, torch.Tensor([[1.0, 1.0]]))[0]" image image and then, how should I solve this problem, please tell me more , Thanks a lot!

Our code is running on CPUs, whereas the dab_deformable_detr supports GPU only. You can send images and models to GPU before inference. A simple way to modify it:

model = model.cuda()
image = image.cuda()
output = model(image[None])

Thank you very much for the answer, I also solved the problem, wish you success in your career, thanks again

yang-0201 commented 2 years ago

I find this code will inference validation dataset,but I don‘t konw how to inference local pictures.

lebionick commented 2 years ago

Use PIL Image with path to your image and None as target

SlongLiu commented 2 years ago

I update the notebook to support visualizing custom images. See https://github.com/IDEA-opensource/DAB-DETR/blob/main/inference_and_visualize.ipynb for more details.

I find this code will inference validation dataset,but I don‘t konw how to inference local pictures.