Git Product home page Git Product logo

image-captioning-v2's Introduction

图像中文描述

图像中文描述 + 视觉注意力的 PyTorch 实现。

Show, Attend, and Tell 是令人惊叹的工作,这里是作者的原始实现。

这个模型学会了“往哪瞅”:当模型逐词生成标题时,模型的目光在图像上移动以专注于跟下一个词最相关的部分。

依赖

  • Python 3.5
  • PyTorch 0.4

数据集

使用 AI Challenger 2017 的图像中文描述数据集,包含30万张图片,150万句中文描述。训练集:210,000 张,验证集:30,000 张,测试集 A:30,000 张,测试集 B:30,000 张。

image

下载点这里:图像中文描述数据集,放在 data 目录下。

网络结构

image

用法

数据预处理

提取210,000 张训练图片和30,000 张验证图片:

$ python pre-process.py

训练

$ python train.py

可视化训练过程,执行:

$ tensorboard --logdir path_to_current_dir/logs

演示

下载 预训练模型 放在 models 目录,然后执行:

$ python demo.py
原图 注意力
image
image
image
image
image
image
image
image
image
image

image-captioning-v2's People

Contributors

foamliu avatar foamliu-ms avatar

Watchers

paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.