kritiksoman / GIMP-ML

AI for GNU Image Manipulation Program
https://kritiksoman.github.io/GIMP-ML-Docs/index.html
MIT License
1.39k stars 126 forks source link

GIMP3-ML enhancements #59

Open ivvv opened 1 year ago

ivvv commented 1 year ago

I am on macOS 13.0 (Ventura), Apple M1 Pro

Installed the development version of GIMP for MacOS : 2.99.14

In a dedicated conda environment with python 3.10:

Installed PyTorch nightly: 2.0.0.dev20230121 and the rest of the required python packages for GIMP3-ML.

Forked GIMP3-ML branch and did the following enhancements:

  1. Move away from pickle, use YAML for human readable config and output files
  2. Avoid using .cuda() in order to implement Apple Metal MPS backend too. Use torch.device() instead.

Refactored all code in tools and plugins with the above changes, plus the two pending pull requests in order to make it work with GIMP 2.99.14.

All(*) works as expected for both CPU and MPS backends from python and from GIMP Layer/GIMP-ML.

If there is interest I can push my changes to a dedicated branch.

(*) for the moment I only have one trouble with coloring from GIMP, the coloring layer is just a copy of the input image, while the cache.png file in the GIMP-ML folder is colored and I cannot figure out why it's not picked up for the colored layer. Coloring from python works as expected. Working on this...