Plugin to integrate Gimp with Meta Segment Anything - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: Plugin to integrate Gimp with Meta Segment Anything (/Thread-Plugin-to-integrate-Gimp-with-Meta-Segment-Anything) Pages:
1
2
|
RE: Plugin to integrate Gimp with Meta Segment Anything - khemadeva - 10-12-2023 (10-10-2023, 03:43 PM)denzjos Wrote: Installed CUDA (coffee time.............). Got this error after trying to install PyTorch on the windows command line : Can't find pip3. Please control if you used the right name and try again. Please check this for pip3 on windows (I got this by doing a search): https://stackoverflow.com/questions/41501636/how-to-install-pip3-on-windows I guess you will get most of the issues resolved by doing a search on net. You can still let me know if you are stuck at any place and I will try to help as far as I can. But since I don't have Windows, I won't be able to check on the windows specific issues. BTW you need to install CUDA only if you have GPU. RE: Plugin to integrate Gimp with Meta Segment Anything - denzjos - 10-12-2023 (10-12-2023, 01:19 PM)khemadeva Wrote:(10-10-2023, 03:43 PM)denzjos Wrote: Installed CUDA (coffee time.............). Got this error after trying to install PyTorch on the windows command line : Can't find pip3. Please control if you used the right name and try again. khemadeva, thanks for the aswer. I won't spend to much time on installing this plugin. Maybe I try it another time again because it's timeconsuming. RE: Plugin to integrate Gimp with Meta Segment Anything - LeafAtWood - 11-07-2023 Thanks khemadeva for the plugin, though I am having trouble registering it with my GIMP 2.10 on macOS 10.15.7. I have run your install validation script (/path/to/python3/python ./seganybridge.py vit_h /path/to/checkpoint/model/sam_vit_h_4b8939.pth) and got a Success. I have put the seganybridge.py and seganyplugin.py in the /Users/me/Library/Application Support/GIMP/2.10/plug-ins repository. I also changed the mode so that these files are executable (chmod 777). Made sure I restarted GIMP. I also made sure SAM was properly installled by running the script amg.py from the SAM github and generated the segmentation masks. So seems my only trouble is registering your plugin with GIMP. Do you have any idea why it is not registering with GIMP and would you know of any way to check/debug the registration process ? I have relayed the news on my Deep_in_Depth twitter channel : https://twitter.com/Deep_In_Depth/status/1721728599651147837 RE: Plugin to integrate Gimp with Meta Segment Anything - LeafAtWood - 11-08-2023 (11-07-2023, 03:49 AM)LeafAtWood Wrote: Thanks khemadeva for the plugin, though I am having trouble registering it with my GIMP 2.10 on macOS 10.15.7. I have run your install validation script (/path/to/python3/python ./seganybridge.py vit_h /path/to/checkpoint/model/sam_vit_h_4b8939.pth) and got a Success. I have put the seganybridge.py and seganyplugin.py in the /Users/me/Library/Application Support/GIMP/2.10/plug-ins repository. I also changed the mode so that these files are executable (chmod 777). Made sure I restarted GIMP. I also made sure SAM was properly installled by running the script amg.py from the SAM github and generated the segmentation masks. So seems my only trouble is registering your plugin with GIMP. Do you have any idea why it is not registering with GIMP and would you know of any way to check/debug the registration process ? Fixed the "registration issue" by just adding the following line to the top of each file seganybridge.py and seganyplugin.py #!/usr/bin/env python There also seem to be a problem with the default plug-ins path on macOS: /Users/me/Library/Application Support/GIMP/2.10/plug-ins due to the space in the path When the seganyplugin.py calls the seganybridge.py it looks like this: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 /Users/efe/Library/Application Support/GIMP/2.10/plug-ins/seganybridge.py vit_h /Users/me/DeepInDepth/SAM/sam_vit_h_4b8939.pth /var/folders/38/hws16c9j0qbfm9_r3t900slw0000gn/T/__seg__7Szrd4.png Auto Multiple /var/folders/38/hws16c9j0qbfm9_r3t900slw0000gn/T/__seg__mask__ True should be: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3[i] "/Users/efe/Library/Application Support/GIMP/2.10/plug-ins/seganybridge.py" [/i]vit_h /Users/me/DeepInDepth/SAM/sam_vit_h_4b8939.pth /var/folders/38/hws16c9j0qbfm9_r3t900slw0000gn/T/__seg__7Szrd4.png Auto Multiple /var/folders/38/hws16c9j0qbfm9_r3t900slw0000gn/T/__seg__mask__ True Even with that change the seganybridge.py does not start. Bizarre! RE: Plugin to integrate Gimp with Meta Segment Anything - khemadeva - 11-19-2023 (11-08-2023, 09:42 AM)LeafAtWood Wrote:(11-07-2023, 03:49 AM)LeafAtWood Wrote: Thanks khemadeva for the plugin, though I am having trouble registering it with my GIMP 2.10 on macOS 10.15.7. I have run your install validation script (/path/to/python3/python ./seganybridge.py vit_h /path/to/checkpoint/model/sam_vit_h_4b8939.pth) and got a Success. I have put the seganybridge.py and seganyplugin.py in the /Users/me/Library/Application Support/GIMP/2.10/plug-ins repository. I also changed the mode so that these files are executable (chmod 777). Made sure I restarted GIMP. I also made sure SAM was properly installled by running the script amg.py from the SAM github and generated the segmentation masks. So seems my only trouble is registering your plugin with GIMP. Do you have any idea why it is not registering with GIMP and would you know of any way to check/debug the registration process ? Have you been able to run the plugin? Do you see any errors on console? Please let me know and I will look into the issue. RE: Plugin to integrate Gimp with Meta Segment Anything - khemadeva - 11-20-2023 (11-08-2023, 09:42 AM)LeafAtWood Wrote:Hello @LeafAtWood I have modified the script on github to accept spaces in the directory, please use the new script. Here are a couple other things to note 1) Make sure the segment-anything folder you created with git clone is in the PYTHONPATH 2) Check the python version from Python-Fu console, it should be 2.7.x. The script will run with only python2 since, to my knowledge, GIMP 2.10 has not yet upgraded to python3. Please let me know if you still face any issues.(11-07-2023, 03:49 AM)LeafAtWood Wrote: Thanks khemadeva for the plugin, though I am having trouble registering it with my GIMP 2.10 on macOS 10.15.7. I have run your install validation script (/path/to/python3/python ./seganybridge.py vit_h /path/to/checkpoint/model/sam_vit_h_4b8939.pth) and got a Success. I have put the seganybridge.py and seganyplugin.py in the /Users/me/Library/Application Support/GIMP/2.10/plug-ins repository. I also changed the mode so that these files are executable (chmod 777). Made sure I restarted GIMP. I also made sure SAM was properly installled by running the script amg.py from the SAM github and generated the segmentation masks. So seems my only trouble is registering your plugin with GIMP. Do you have any idea why it is not registering with GIMP and would you know of any way to check/debug the registration process ? RE: Plugin to integrate Gimp with Meta Segment Anything - tec0 - 11-29-2023 (10-07-2023, 09:33 AM)khemadeva Wrote: I have created a plugin, which allows users to isolate objects within a raster image inside GIMP using Meta Segment Anything. Hi, I have followed all the steps and got a "success!!" from the test, but there is no correct result when using the plugin, there are no layers being created, and shows the following errors: GEGL-Message: 00:49:01.515: Module 'C:\Program Files\GIMP 2\lib\gegl-0.4\exr-save.dll' load error: 'C:\Program Files\GIMP 2\lib\gegl-0.4\exr-save.dll': The specified module could not be found. GEGL-Message: 00:49:01.519: Module 'C:\Program Files\GIMP 2\lib\gegl-0.4\exr-load.dll' load error: 'C:\Program Files\GIMP 2\lib\gegl-0.4\exr-load.dll': The specified module could not be found. 2023-11-29 00:49:01 - DEBUG - pythonPath: C:\Users\s\AppData\Local\Programs\Python\Python310\python.exe C:\Users\s\AppData\Roaming\GIMP\2.10\plug-ins\[color=var(--yt-endpoint-color,var(--yt-spec-call-to-action))]seganyplugin.py:433[/color]: Warning: value "0" of type 'guint' is invalid or out of range for property 'n-rows' of type 'guint' table = gtk.Table(0, 0, False) C:\Users\seana\AppData\Roaming\GIMP\2.10\plug-ins\[color=var(--yt-endpoint-color,var(--yt-spec-call-to-action))]seganyplugin.py:433[/color]: Warning: value "0" of type 'guint' is invalid or out of range for property 'n-columns' of type 'guint' table = gtk.Table(0, 0, False) Could you offer any help on this? RE: Plugin to integrate Gimp with Meta Segment Anything - LeafAtWood - 12-11-2023 (11-20-2023, 05:45 AM)khemadeva Wrote:(11-08-2023, 09:42 AM)LeafAtWood Wrote:Hello @LeafAtWood I have modified the script on github to accept spaces in the directory, please use the new script. Here are a couple other things to note 1) Make sure the segment-anything folder you created with git clone is in the PYTHONPATH 2) Check the python version from Python-Fu console, it should be 2.7.x. The script will run with only python2 since, to my knowledge, GIMP 2.10 has not yet upgraded to python3. Please let me know if you still face any issues.(11-07-2023, 03:49 AM)LeafAtWood Wrote: Thanks khemadeva for the plugin, though I am having trouble registering it with my GIMP 2.10 on macOS 10.15.7. I have run your install validation script (/path/to/python3/python ./seganybridge.py vit_h /path/to/checkpoint/model/sam_vit_h_4b8939.pth) and got a Success. I have put the seganybridge.py and seganyplugin.py in the /Users/me/Library/Application Support/GIMP/2.10/plug-ins repository. I also changed the mode so that these files are executable (chmod 777). Made sure I restarted GIMP. I also made sure SAM was properly installled by running the script amg.py from the SAM github and generated the segmentation masks. So seems my only trouble is registering your plugin with GIMP. Do you have any idea why it is not registering with GIMP and would you know of any way to check/debug the registration process ? Hello @khemadeva, Sorry for the late answer. Didn't activate the "Default Thread Subscription Mode:". So didn't see you answer. Thanks for the update and the advices. Will check the new version ASAP and let you know how it works. RE: Plugin to integrate Gimp with Meta Segment Anything - LeafAtWood - 12-17-2023 Hello khemadeva After installing your new version of the code, I sent the logging output to a file. There is still an issue, but as you can see below it is a more "basic" issue with numpy (multiarray) import in the python 2.7 in python-fu module. Not sure how to fix that. "import numpy" works fine in the interactive python-fu console. The file /Applications/GIMP.app/Contents/Resources/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/_multiarray_umath.so is present. Messages put in the logging file Quote:2023-12-17 07:08:03 - DEBUG - pythonPath: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 RE: Plugin to integrate Gimp with Meta Segment Anything - BeaverGEGLFreak - 02-26-2024 My plugins were briefly brought up in this thread on page 1 in what appears to be an unrelated warning that I get too. I Believe that is caused by someone elses python GEGL plugin and it does no harm. Just please let me know if it turns out my GEGL plugins conflict with this plugin. I doubt that is the case though. |