Package: gemovi
GEnerative MOdel VIsualization (gemovi)InstallationNote! Packages found inrequirements-pinned.txtare fully pinned, meaning you
will get the exact same versions as the ones used in development and there is a high
likelihood that everything works nicely (ifgemoviis the only package you install).
However, several versions of each package are probably also compatible. The only
exception to this is the packages found inrequirements-unreleased.txt, which must
come from git until their next PyPI release.Also note!If you want GPUs to work with pytorch, make sure you have the
correct CUDA+torch version installed (seehere)beforeattempting topip install -egemvoi.In any case, after cloning this package, you can install it as follows:# *Please* use a virtual environment. It will make package management easier# and you will not have to worry about messing up your system Python.# Any python virtual environment manager will do, but I use (mini)condacondacreate-ngemovi-envpython=3.10-y
condaactivategemovi-env

gitclonehttps://gitlab.com/ntjess/gemovi.git# See discussion above about installing pinned requirements# pip install -r ./gemovi/requirements-pinned.txt# See discussion about installing pytorch with GPU support# before installing gemovi# Use "train" if you want to train a model as well as visualizepipinstall-e"./gemovi[train]"# Note that one of PyQt5, PyQt6, PySide2, PySide6 is also required. This# check will fail if you do not have one of these installed.python-c"import pyqtgraph"# Finally check if the visualization entrypoint workspython-mgemovi.viz--helpUsagegemovisupports training and visualizing various forms of VAEs (along with DCGAN -- a deep convolutional generative adversarial network). It supports a config file very much likePyTorch-VAEto specify where data lives, how large to make the input images, etc. While most parameters are only relevant during training, some, such as model hyperparameters, are useful to spawn the rigth network during visualization and weight loading.TrainingAssume you have training images stored inpath/to/images. This folder should be full of supported image formats, i.e.,.jpg,.png, etc. You can train a VAE with the following command:python-mgemovi.vae.train--configpath/to/config.yamlwherepath/to/config.yamlis a config file that looks likethis. If your config file lives ingemovi/common/configs/, you can simply pass the filename instead of the full path.Note that you must specifydata_params>data_pathto bepath/to/imagesandtrainer_params>model_nameto be the desired VAE architecture. If your hardware is different from a 1-GPU setup, be sure to changetrainer_params>{accelerator,devices}accordingly.If you wish to resume training from a previous run, specify the saved.ckptfile intrainer_params>ckpt_path.Note this procedure is almost exactly the same for a DCGAN. The only difference is the top-level command:python-mgemovi.dcgan.train--configpath/to/config.yamlAssumingtrainer_params>log_dirwas unchanged, your current directory should begin populating with model checkpoints, sample reconstructions, and tensorboard logs under./lightning_logs.Visualization[Note: If thefirepackage is installed, the--helpcommand will print much more detailed argument information.]Assume you trained a MSSIMVAE previously withpython -m gemovi.vae.train --config path/to/config.yaml. You can visualize the latent space with the following command:python-mgemovi.viz--model_classMSSIMVAE--config_filepath/to/config.yaml--weights_filepath/to/checkpoint.ckpt