This repo contains a python script for converting LaMa pretrained models (.ckpt files) to Apple's Core ML model format. Pretrained models can be downloaded at Google Drive (link is taken from the official LaMa repo). Use LaMa_models.zip for big-lama, lama-places, lama-celeba, etc. big-lama.zip if you need to convert big-lama only. Alternatively, you can use your own ckpt files. Just point the script to a folder with 'config.yaml' and 'models/best.ckpt'. See Customize script section for details.
The script does not require IOPanit (marked as archived) for the conversion.
-
Create a Conda environment:
conda create -n lamatocoreml python=3.9 -y conda activate lamatocoreml pip install -r requirements.txt
-
Customize script:
lama_pretrained_models_path = "LaMa_models/big-lama" # point to a folder with 'config.yaml' and 'models/best.ckpt' lama_input_size = 1024 #px
-
Run the conversion script:
python convert.py
Authors of LaMa:
[Project page] [arXiv] [Supplementary] [BibTeX] [Casual GAN Papers Summary]
Support us by downloading Pixea image viewer for macOS.
