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

您好,如果想预测出测试集图片后把所有的预测结果图片保存到一个文件夹,不是随机展示,该怎么改呢 #36

Open
Wangcancan1127 opened this issue Dec 9, 2020 · 2 comments

Comments

@Wangcancan1127
Copy link

您好,想问一下如果想预测出测试集图片后把所有的预测结果图片保存到一个文件夹,不是随机展示,该怎么改呢,希望您能回复,非常感激您

@yizt
Copy link
Owner

yizt commented Dec 10, 2020

@Wangcancan1127 在display_instances函数中,将_, ax = plt.subplots(1, figsize=figsize)改为,fig, ax = plt.subplots(1, figsize=figsize),并返回fig; 然后每个fig保存就好

@Wangcancan1127
Copy link
Author

你好我改了
if not ax:
fig, ax = plt.subplots(1, figsize=figsize)
auto_show = True
return fig
但是inference.py里面也要改吧
image_ids = np.random.choice(len(all_img_info), 9, replace=False)
fig = plt.figure(figsize=(20, 20))
for idx, image_id in enumerate(image_ids):
ax = fig.add_subplot(3, 3, idx + 1)
_show_inference(image_id, ax)
fig.savefig('demo_images/inferece_examples.{}.png'.format(np.random.randint(10)))
这块也需要改吧

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