Code Monkey home page Code Monkey logo

ads2018's Introduction

Implementation of our approach for Automatic Understanding of Visual Advertisements Challenge (1st place of 2018 challenge).

Requirements

You need to have following packages:

  • chainer
  • chainercv
  • keras
  • cupy
  • gensim
  • nltk
  • pandas
  • pytables
  • parse

We also provide a Dockerfile to setup dependencies.

We use Google word2vec to compute word embeddings. Download GoogleNews-vectors-negative300.bin.gz here and set WORD2VEC_PATH.

export WORD2VEC_PATH=/path/to/Word2Vec/GoogleNews-vectors-negative300.bin

Data

You can get the competition dataset here. Downlaod the training/test datasets and extracut them in the data directory.

We also use OCR results. Download the OCR results (figshare) and save in the data directory.

Preparation

Before training, pre-compute Faster-RCNN features of ad images.

VA_DATASET_ROOT=/path/to/VisualAdvertisementDataset/ python script/save_feat.py

Otherwise, you can download precomputed Faster-RCNN features (figshare), and copy to data/frcnn_feat/.

Training

To train our full model, run

python script/train.py --model_name ocr+vis --text_net cnn

An output directory will be made under /output/checkpoint/, and a trained model and some other output files will be saved in the directory.

Evaluation

To evaluate a model, run

python script/train.py --eval /path/to/output/directory

Reproduce the competition results

Download two figshare items Chainer model file and tokenizer and word embeddings (figshare). Copy wordvec.npy and tokenizer.pickle to data directory, then run

python script/train.py --eval /path/to/directory/of/Chainer_model_file

Visualizing the results

We included some code snippets for visualization. See notebook/visualize inference.ipynb.

ads2018's People

Contributors

mayu-ot avatar

Stargazers

Norio Kosaka avatar  avatar Keren Ye avatar  avatar Smrutiranjan Sahu avatar chck avatar Kota Yamaguchi avatar Shunsuke KITADA avatar

Watchers

James Cloos avatar

Forkers

v-user1098new

ads2018's Issues

frcnn_feat is corrupted

As the title, when I doing data preparation, I can't unzip the frcnn_feat after downloaded.

Had look in more detail and found out that there is a problem with train.h5, test.h5 can be extracted but train.h5 can't.

Can I get the train.h5 which is uncorrupted?

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.