NTS-Net icon indicating copy to clipboard operation
NTS-Net copied to clipboard

Anchor boxes visualization

Open ygean opened this issue 5 years ago • 9 comments

@yangze0930 Hi, I get self.top_n_cdds in model.py/attention_net and then I pad image to 896 x 896 size, draw anchor boxes in padded image. Have I done something wrong in this procedure? I wanna know how you visualize anchor boxes in image, I'd like you can reply as soon as possible sincerely, thanks a lot

ygean avatar Jan 01 '19 06:01 ygean

可视化比较简单,这样做 `,anchors,=generate_default_anchor_maps() print type(anchors),anchors.shape

print len(anchors) for anc in anchors: if anc[0]<0 or anc[1]<0 or anc[2]<0 or anc[3]<0: print anc

import matplotlib.pyplot as plt xmin=-224 xmax=672 ymin=-224 ymax=672 fig = plt.figure(figsize=(8,8)) ax = fig.add_subplot(111) plt.xlim( (xmin, xmax) ) plt.ylim( (ymin, ymax) ) #rect = plt.Rectangle((0.1,0.1),0.5,0.3) #ax.add_patch(rect) for anch in anchors: rect = plt.Rectangle((anch[1],anch[0]),#(x0,y0) anch[3]-anch[1],#width anch[2]-anch[0],#height edgecolor='r', facecolor='none') ax.add_patch(rect) plt.show()`

zbxzc35 avatar Jan 04 '19 03:01 zbxzc35

I want to know how to draw the box when testing , so that i can find if the network focus the most import regins. The paper had a amazing visualization.

ray-lee-94 avatar Jan 16 '19 09:01 ray-lee-94

Actually, I did it by my mentioned approach not zbxzc35 mentioned . But it seems does not have amazing visualization , which anchor boxes should be localized discriminative feature regions on image directly, my visualization result told me that effect of RPN module still confuses me. It need author's help to tell more details.

ygean avatar Jan 16 '19 09:01 ygean

@VCBE123 I think you need to find anchor boxes selected by trained model and pad your image with constant value for resizing image's size and then, the way of drawing anchor boxes on PIL image format is easy on searching from stackoverflow.com, good luck for you, guy.

ygean avatar Jan 16 '19 09:01 ygean

@zhouyuangan Thank you for your help.

ray-lee-94 avatar Jan 16 '19 10:01 ray-lee-94

@zbxzc35 为什么坐标是 -224 672 输入图片大小不是 448*448 吗,这样的设置不会导致坐标超出图片的大小吗

dongzhi0312 avatar Apr 16 '19 11:04 dongzhi0312

@VCBE123 I think you need to find anchor boxes selected by trained model and pad your image with constant value for resizing image's size and then, the way of drawing anchor boxes on PIL image format is easy on searching from stackoverflow.com, good luck for you, guy.

Hello, when I run test.py on CUB_200 dataset, nothing has been output.Is this normal? then where to find the result of bounding boxes of the test images ? without the bbox information how can I visualize? I really need help.

jxingm avatar Nov 29 '19 14:11 jxingm

@VCBE123 I think you need to find anchor boxes selected by trained model and pad your image with constant value for resizing image's size and then, the way of drawing anchor boxes on PIL image format is easy on searching from stackoverflow.com, good luck for you, guy.

Hello, when I run test.py on CUB_200 dataset, nothing has been output.Is this normal? then where to find the result of bounding boxes of the test images ? without the bbox information how can I visualize? I really need help.

I would like to ask, did you successfully draw the bounding box during the test? How to visualize? thank you very much.

dawnsdaw avatar Nov 20 '20 12:11 dawnsdaw

#25

atnegam avatar Mar 22 '23 07:03 atnegam