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

有没有图像描述生成器代码 #13

Open
Dmygithub opened this issue Apr 20, 2024 · 1 comment
Open

有没有图像描述生成器代码 #13

Dmygithub opened this issue Apr 20, 2024 · 1 comment

Comments

@Dmygithub
Copy link

你好,模型训练好后应该如何应用呢?
例如给一张图片,如何生成图像描述?

@zchoi
Copy link
Owner

zchoi commented Jul 12, 2024

您好,由于本项目是离线视觉特征训练和测试,如果要实际部署,需要修改成端到端推理。有几点建议包括但不限于:1. 修改dataloader,从而对输入图像进行online的特征抽取,见#12 ,2. 下面的代码包含了模型输出解码和评测,gts如果不需要你可以删除掉,只要模型当前的输出gen_i即可。

caps_gen = text_field.decode(out, join_words=False)
for i, (gts_i, gen_i) in enumerate(zip(caps_gt, caps_gen)):
gen_i = ' '.join([k for k, g in itertools.groupby(gen_i)])
gen['%d_%d' % (it, i)] = [gen_i.strip(), ]
gts['%d_%d' % (it, i)] = gts_i

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