Pytti-Tools can be run without any complex setup -- completely for free! -- via google colab. The instructions below are for users who would like to install pytti-tools locally. If you would like to use pytti-tools on google colab, click this button to open the colab notebook:
- Python 3.x
- Pytorch
- CUDA-capable GPU
- OpenCV
- ffmpeg
- Python Image Library (PIL/pillow)
- git - simplifies downloading code and keeping it up to date
- gdown - simplifies downloading pretrained models
- jupyter - (Optional) Notebook interface
The following instructions assume local setup. Most of it is just setting up a local ML environment that has similar tools installed as google colab.
- https://www.anaconda.com/products/individual
- https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
The pytti-notebook folder will be our root directory for the rest of the setup sequence.
git clone https://github.com/pytti-tools/pytti-notebook
cd pytti-notebook
conda create -n pytti-tools
conda activate pytti-tools
The environment name shows up at the beginning of the line in the terminal. After running this command, it should have changed from (base)
to (pytti-tools)
. The installation steps that follow will now install into our new "pytti-tools" environment only.
Follow the installation steps for installing pytorch with CUDA/GPU support here: https://pytorch.org/get-started/locally/ . For windows with anaconda:
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
conda install tensorflow-gpu
conda install -c conda-forge opencv
conda install -c conda-forge pillow
conda install -c conda-forge imageio
conda install -c conda-forge pytorch-lightning
conda install -c conda-forge kornia
conda install -c huggingface transformers
conda install scikit-learn pandas
pip install jupyter gdown loguru einops seaborn PyGLM ftfy regex tqdm hydra-core adjustText exrex matplotlib-label-lines
git clone --recurse-submodules -j8 https://github.com/pytti-tools/pytti-core
pip install ./pytti-core/vendor/AdaBins
pip install ./pytti-core/vendor/CLIP
pip install ./pytti-core/vendor/GMA
pip install ./pytti-core/vendor/taming-transformers
pip install ./pytti-core
If you skip this step, PyTTI will do it for you anyway the first time you import it.
python -m pytti.warmup
Your local directory structure probably looks something like this now:
├── pytti-notebook
│ ├── config
│ └── pytti-core
If you want to "factory reset" your default.yaml, just delete the config folder and run the warmup command above to rebuild it with PyTTI's shipped defaults.
pip uninstall -y ./pytti-core/vendor/AdaBins
pip uninstall -y ./pytti-core/vendor/CLIP
pip uninstall -y ./pytti-core/vendor/GMA
pip uninstall -y ./pytti-core/vendor/taming-transformers
pip uninstall -y pyttitools-core;
rm -rf build
rm -rf config
rm -rf pytti-core
git clone --recurse-submodules -j8 https://github.com/pytti-tools/pytti-core
pip install ./pytti-core/vendor/AdaBins
pip install ./pytti-core/vendor/CLIP
pip install ./pytti-core/vendor/GMA
pip install ./pytti-core/vendor/taming-transformers
pip install ./pytti-core
python -m pytti.warmup