Thug Memes

Command line Thug Meme generator written in Python.

Installation

Requirements

Python 3.4+

pip3 install thug-memes

This installs the core version which supports opencv haarcascade based detector. If you are serious with your thug memes (like you definitely should), there is also support for dlib based detector which, in general, provides better results. If you want to enjoy dlib's accuracy, please follow dlib's own installation instructions.

Usage

thug path/to/the/original/image 'JUST CASUALLY LIFTING' '20KGs HERE'

Will store something like this in your current directory:

1_face_out_thug

If you have installed dlib and want to use it instead of opencv detector, add option:

--detector dlib

If you want to see the results of the detection, add --debug option:

Opencv (--debug):

1_face_debug_opencv

Dlib (--detector dlib --debug):

1_face_debug_dlib

Almost everything is configurable. You can see the used configuration with:

--show-config

The default configuration is in src/thug/defaul.conf. You can override this by defining environment variable THUG_CONF and pointing it to a file which contains overrides. In addition, you can override any of the configuration variables from command line with --override or -o options. For example:

thug path/to/original/img.jpg 'WE HAVE HUGE CIGARS' 'BUT ALSO PINK TEXT' --detector dlib -o cigar_length 2 -o glasses_width 5 -o font_bgr '[180,105,255]'

3_faces_thug_custom

For all available options, see:

thug --help

If you don't want to have awesome Thug elements in your meme, there is also 'a plain meme' alternative:

meme path/to/the/original/image 'THIS IS A NORMAL MEME' 'WITHOUT THUG STUFF :(' -o font_bgr '[255,255,255]'

normal_meme_out

GitHub