kritiksoman / GIMP-ML

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

Python 2.7 #4

Closed ngonthier closed 3 years ago

ngonthier commented 4 years ago

Hi,

Python 2.7 is no more maintained. You should convert your project in Python 3.

Best,

kritiksoman commented 4 years ago

Yes, will do with GIMP 3.

joemarshall commented 4 years ago

It might be possible to convert the backend machine learning stuff to python 3, then run that bit with rpyc, to allow it to work on 2.10 but with the current versions of libraries and modern python.

It would a) potentially simplify install (you could just bundle the backend server as a py2exe.) b) mean windows support would be possible as torch is python 3 only, and c) mean that example code from recent research could be used without the effort of back porting to 2.7.

I might give this a go to see how hard it would be, as I would like the plugin on Windows.

joemarshall commented 4 years ago

Scratch that, rpyc is broken between 2.7 and 3 right now, easier solution is to just pipe the image data into a python 3 process, and pipe progress and results back. Is pretty trivial stuff, just reading from stdin in the backend and writing to a subprocess pipe in frontend. This would mean development on the gimp 3 plugin frontend could be completely separate to the plugins themselves, so that work wouldn't break 2.10 compatibility before 3 final comes out.

It would also give the potential for the plugins to be used in other apps too, kind of like ffmpeg is used in many things.

PatrickWauters commented 4 years ago

Hello! Thank you for providing these plugins. I'm using Gimp 2.10.18 on Ubuntu 20.04 (installed with apt). I'm eager to try them out however can't get the plugins to work. From gimp --verbose --console-messages

_Querying plug-in: '/home/user/Gimp/GIMP-ML/gimp-plugins/super_resolution.py' GIMP-Error: Unable to run plug-in "super_resolution.py" (/home/user/Gimp/GIMP-ML/gimp-plugins/super_resolution.py)

Failed to execute child process “/home/user/Gimp/GIMP-ML/gimp-plugins/superresolution.py” (Exec format error)

Is this a clash between python2 and python3 as they are both on my system? Any pointers on how to fix this?

BR

0xRampey commented 4 years ago

Even with python2.7 I get the same error,

Parsing '/home/prudhvirampey/.config/GIMP/2.10/pluginrc'
Querying plug-in: '/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/super_resolution.py'
GIMP-Error: Unable to run plug-in "super_resolution.py"
(/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/super_resolution.py)

Failed to execute child process “/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/super_resolution.py” (Exec format error)

Querying plug-in: '/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/monodepth.py'
gimp: LibGimpBase-WARNING: gimp: gimp_wire_read(): error
Terminating plug-in: '/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/monodepth.py'
Querying plug-in: '/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/invert.py'
gimp: LibGimpBase-WARNING: gimp: gimp_wire_read(): error
Terminating plug-in: '/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/invert.py'
Querying plug-in: '/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/faceparse.py'
GIMP-Error: Unable to run plug-in "faceparse.py"
(/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/faceparse.py)

Failed to execute child process “/home/prudhvirampey/Documents/GIMP-ML/gimp-plugins/faceparse.py” (Exec format error)

I think this might not be python version related. Any help on this would be appreciated!

frumble commented 3 years ago

I have described the same problem here. Might it be a platform-specific bug? Does the plugin make use of any Darwin binaries which naturally won’t work on Linux systems?

kritiksoman commented 3 years ago

We have started development using python 3. https://github.com/kritiksoman/GIMP-ML/tree/GIMP3-ML