Giter VIP home page Giter VIP logo

dank-learning's Introduction

Dank Learning: Generating Memes Using Deep Neural Networks

Alt text Alt text Alt text Alt text

Overview

This is the code for the paper Dank Learning: Generating Memes Using Deep Neural Networks (https://arxiv.org/abs/1806.04510) and for the associated iOS app Dank Learning (https://danklearning.com/).

Abstract

We introduce a novel meme generation system, which given any image can produce a humorous and relevant caption. Furthermore, the system can be conditioned on not only an image but also a user-defined label relating to the meme template, giving a handle to the user on meme content. The system uses a pretrained Inception-v3 network to return an image embedding which is passed to an attention-based deep-layer LSTM model producing the caption - inspired by the widely recognised Show and Tell Model. We implement a modified beam search to encourage diversity in the captions. We evaluate the quality of our model using perplexity and human assessment on both the quality of memes generated and whether they can be differentiated from real ones. Our model produces original memes that cannot on the whole be differentiated from real ones.

Apple App available!

Try the meme generator out for yourself: see https://danklearning.com/

Just here for the data?

The data we scraped using scraper.py can be found in im2txt/memes (images) and im2txt/captions.txt (associated captions).

Installation

Clone the repo

git clone [email protected]:alpv95/MemeProject

Now cd in

cd Dank-Learning

Create a virtual environment and activate it

python -m virtualenv venv
source venv/bin/activate

Now install dependencies

pip install tensorflow Pillow jupyter

We've forked our own tf-coreml, which you can install in the virtual environment by doing the following:

cd tf-coreml/
pip install -e .
cd ..

Copy in the big files (word embedding matrix & trained DNN weights) from this Google Drive: https://drive.google.com/drive/folders/1R8YRzh0LWno6TiQBTtdoNP73D5GiYviF?usp=sharing

cp [path]/REAL_EMBEDDING_MATRIX im2txt/REAL_EMBEDDING_MATRIX
cp -r [path]/trainlogIncNEW im2txt/trainlogIncNew

Now you should be all set up.

Running

Get Jupyter notebooks fired up

jupyter notebook

Navigate in the browser that launched to im2txt/Meme_Maker.ipynb and follow the steps in the notebook to generate your own memes! Also see im2txt/model_conversion_debug.ipynb for how we converted the model to tf-coreml for use on iOS.

dank-learning's People

Contributors

alpv95 avatar freedmand 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.