CASIA-IVA-Lab/DPT

Visualization of boxes

o0t1ng0o opened this issue · 1 comments

Hi @volgachen,

I follow this code #10 (comment) to visualize the boxes.
Due to the amplifier=2, I resize the image to (224*2)X(224*2) and plot the boxes, centers and anchors in the image.
In this figure, the red points are anchors, the blue points are centers of boxes, and red rectangles are the boxes.

But I found that some boxes are outside the image.
I am wondering whether this is caused by the '16' in the following two lines in the code?

  1. boxes = (box_coder.boxes[0] * 224 + 16 ) * amplifier
  2. anchors = [(patch_embed.box_coder.anchor * 224 + 16)*amplifier for patch_embed in patch_embeds]

Or do I need to resize image to (256*2)X(256*2) during visualization since it preprocesses images by resizing to 256 and centercropping to 224?

image

Thank you very much.
Looking forward to further discussion with you.

wxqlab commented

Hi @volgachen @ivaopenlab,
I also found this issue.
Can you provide some example codes for visualization?

Thank you in advance.