Compresses Twemoji emojis down to 64 bytes (16 4-bit floating point numbers).
This repository contains an already pretrained model for web use. You can use it as-is without training by hosting
the www
directory on a web server.
To test the shipped model, just follow this link.
- Clone this repository.
- Install Python 3.6 or later and the accompanying
pip3
module. - (Optional) Create a
virtualenv
for this project. - Run
pip3 install -r requirements.txt
. - (Optional) Install the GPU support libraries to use your GPU to train the model.
- (Optional) (If you installed the GPU libraries) Install the
tensorflow-gpu
package usingpip3 install tensorflow-gpu
.
- Navigate to the
src
directory. - Run
python3 svg2png.py
to download and convert the images to a usable format.
Now we are all set, time to train the network:
- Navigate to the
src
directory. - Run
python3 autoencoder.py
To prepare the trained model for use in the web, use the tensorflowjs_converter
.
If you have used virtualenv
to create a virtual environment on Windows, you can find the tensorflowjs_converter.exe
file in <virtualenv directory>\Scripts\tensorflowjs_converter.exe
.
On other operating systems, the binary should already be in your $PATH and ready to be used.
<tensorflowjs_converter> --input_format keras --output_format tfjs_layers_model logs\<latest directory>\model.h5 www
Due to the use of tfjs
, you have to host the www
directory on a web server.
Just open the index.html
file in your browser and use the model or design your own page for it.