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

Anchor boxes visualization #10

Open
ygean opened this issue Jan 1, 2019 · 9 comments
Open

Anchor boxes visualization #10

ygean opened this issue Jan 1, 2019 · 9 comments

Comments

@ygean
Copy link

ygean commented Jan 1, 2019

@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

@zbxzc35
Copy link

zbxzc35 commented Jan 4, 2019

可视化比较简单,这样做
`,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()`

@ray-lee-94
Copy link

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.

@ygean
Copy link
Author

ygean commented Jan 16, 2019

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
Copy link
Author

ygean commented Jan 16, 2019

@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.

@ray-lee-94
Copy link

@zhouyuangan Thank you for your help.

@dongzhi0312
Copy link

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

@jxingm
Copy link

jxingm commented Nov 29, 2019

@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.

@dawnsdaw
Copy link

@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.

@atnegam
Copy link

atnegam commented Mar 22, 2023

#25

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

7 participants