Skip to content

schesa/ai-memes

Repository files navigation

Ai memes

About | Web Arhitecture | Neural Network | ImgFlip API | GRPC Server | Backend | Frontend | Examples | References

About

Generating memes using Neural Networks

Dataset used: ImgFlip575K_Dataset

Neural Network

Code -> net/ai-memes.ipynb

Colab notebook -> ai-memes.ipynb

Used Show and Tell Model[1][2].

Training

Colab

  • Trained for all memes
  • 50 epochs, batch size 32
  • GPUs: Tesla K80 / Tesla P100-PCIE-16GB

Windows 10

  • Managed to train for a small number of memes(10).

  • Used GPU NVIDIA GeForce GTX 950M with CUDA 9.0, CuDNN 7.3.1 installed

  • Anaconda environment with: python 3.6.8, TF-GPU 1.12 installed as in here.

Web Arhitecture

Arhitecture

GRPC Server

Connected to django SQLite db

Uses the neural network to generate captions

Is a Grpc server and sends request to Grpc client ( ImgFlip API ) to get link with the captioned img

Backend

Django and Graphene

Used default SQLite db

Frontend

Developed in Vue.js using cool lottie animations

Uses GraphQL to get and create memes from backend

ImgFlip API

To run

$> cd ./api
$> touch .env

Add your ImgFlip account info to .env file

IMGFLIP_USERNAME=<your ImgFlip account>
IMGFLIP_PASSWORD=<your ImgFlip password>

Run the server

$> npm start

Api examples

Call examples found in /api/src/index.js

ex1. https://i.imgflip.com/3vh5hr.jpg

ex2. https://i.imgflip.com/3vh5hs.jpg

Examples

ex1

ex2

References

[1] Oriol Vinyals, Alexander Toshev, Samy Bengio, & Dumitru Erhan. (2014). Show and Tell: A Neural Image Caption Generator.

[2] Jeff Heaton. Washington University (in St. Louis) Course T81-558: Applications of Deep Neural Networks Module 10: Time Series in Keras. https://github.com/jeffheaton/t81_558_deep_learning