Adjective-Object / first-order-motion-tk

MIT License
1 stars 1 forks source link

First-Order-Motion Realtime

An app to make realtime access to first-order-motion approachable.

Demo with Toast Man Demo with Frodo Baggins

based on https://github.com/AliaksandrSiarohin/first-order-model and https://github.com/k0staa/real-time-example-of-first-order-motion-model-for-image-animation

Requirements

Controls

Setup and running from source

pipenv install --dev
pipenv run python ./app.py

Building a Distributable

# get dependencies (including pyinstaller)
pipenv install --dev

# Before proceeding, update the absolute paths in app.spec so they
# are accurate on your machine.

# package the app
pipenv run pyinstaller --noconfirm app.spec
# or package it on windows
pipenv run pyinstaller --noconfirm app.win.spec

# check it runs
./dist/first-order-motion-tk/app
# build a distributable zip
zip -r ./dist/first-order-motion-tk-linux.zip ./dist/first-order-motion-tk
# or, build a distributable tar.xz if the zip is too big
tar -cf - ./dist/first-order-motion-tk | xz -4e > ./dist/first-order-motion-tk.tar.xz

Profiling

# Sampling profile of CPU usage
pipenv run py-spy record -o profile.svg --subprocesses -- python app.py
# Chart memory usage over time
pipenv run psrecord "python app.py" --plot memplot.png --include-children
# log traced allocations
pipenv run python app.py --trace