Python Server for Avatar Stickers iOS Application. Server generates animations in TGS and WebP formats using Lottie. Source code of iOS application available here. The application was created while participating in the contest.
You can deploy server on Heroku in a minute
Demo server is available at facemotion.herokuapp.com. It automatically deployed from main branch on changes. Demo server isn't used in production and uses free dyno plan.
- Python 3.8 (or newer)
# Clone
git clone 'https://github.com/starkdmi/AvatarStickersServer'
cd AvatarStickersServer
# Install requirements
pip install -r requirements.txt
# Run
python -m uvicorn app:app --host=macpro.home --port=5000 --reload
Use local network hostname to easily access the server from mobile device while testing.
Field | Description | Type | Default | Values | Required |
---|---|---|---|---|---|
service | Messenger name | String | telegram | telegram, whatsapp | YES |
emotion | Name of animation | String | Amazing, Excited, Laugh, Please, Love, Sad, Angry, Crying, Emotionless, Smile, Wink, Football, Basketball | YES | |
hair | Hair style or Hat type | String | no_hair | Hair Styles: no_hair, big_hair, bob, bun, caesar_side_part, caesar, curly, curvy, dreads, frida, 'rizzle, fro_band, fro, long_not_too_long, mia_wallace, shaggy_mullet, shaggy, shaved_sides, short_curly, short_dreads_1, short_dreads_2, short_flat, short_round, short_waved, sides, straight_1, straight_2, straight_strand Hats: hat, hijab, turban, winter_hat_1, winter_hat_2, winter_hat_3, winter_hat_4 |
NO |
eyebrows | Eyebrows type | String | default | closed, cry, default, eye_roll, happy, heart, side, surprised, wink_wacky, wink, x_dizzy, squint | NO |
eyes | Eyes type | String | default | '', angry_natural, default_natural, default, flat_natural, frown_natural, up_down, up_down_natural, raised_excited_natural, raised_excited, sad_concerned_natural, sad_concerned, unibrow_natural, angry | NO |
mouth | Mouth emotion | String | default | concerned, default, disbelief, eating, grimace, sad, scream_open, serious, smile, tongue, twinkle, vomit | NO |
beard | Facial hair style | String | '' | '', beard_light, beard_magestic, beard_medium, moustache_fancy, moustache_magnum | NO |
gender | Sex | String | male | male, female | NO |
accessory | Accessories type | String | '' | '', eyepatch, kurt, prescription_01, prescription_02, round, sunglasses, wayfarers | NO |
clothes | Clothes | String | graphic_shirt | '', blazer_shirt, blazer_sweater, collar_sweater, graphic_shirt, hoodie, overall, shirt_crew_neck, shirt_scoop_neck, shirt_v_neck | NO |
shirt_graphic | Draw an icon on clothes. Field clothes should be set to graphic_shirt. | String | custom_text | '', bat, bear, cumbia, custom_text, deer, diamond, hola, pizza, resist, selena, skull_outline, skull | NO |
shirt_text | Text written on clothes. Field shirt_graphic should be set to custom_text. | String | '' | Some text | NO |
clothesColor | Clothes color | String | HEX String - #FFFFFF | NO | |
beardColor | Facial hair color | String | HEX String - #FFFFFF | NO | |
hairColor | Hair color | String | HEX String - #FFFFFF | NO | |
hatColor | Hat color | String | HEX String - #FFFFFF | NO | |
skinColor | Skin tone color | String | HEX String - #FFFFFF | NO | |
text_color | Text color | String | HEX String - #FFFFFF | NO |
curl -X POST \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Token: SERVER_TOKEN' \
-d '{"service": "telegram", "emotion": "Laugh", "gender": "female", "mouth": "smile", "eyes": "happy", "eyebrows": "default", "hair": "long_not_too_long", "clothes": "hoodie", "hairColor": "#A55727", "skinColor": "#EDB98A", "clothesColor": "#E0543A"}' 'http://macpro.home:5000/avatar' > animation.json
- python_avatars - MIT
- python-lottie - GNU AGPLv3
- lottie-web - MIT
- twemoji - MIT
- Pacifico - Open Font License
- Faster One - Open Font License
- Gee-me - CC 4.0