Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plugin to integrate Gimp with Meta Segment Anything
#11
(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/4150...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.
Reply
#12
(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.

Please check this for pip3 on windows (I got this by doing a search):
https://stackoverflow.com/questions/4150...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.

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.
Reply
#13
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...9651147837
Reply
#14
(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 ?

I have relayed the news on my Deep_in_Depth twitter channel : https://twitter.com/Deep_In_Depth/status...9651147837

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!
Reply
#15
(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 ?

I have relayed the news on my Deep_in_Depth twitter channel : https://twitter.com/Deep_In_Depth/status...9651147837

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!

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.
Reply
#16
(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 ?

I have relayed the news on my Deep_in_Depth twitter channel : https://twitter.com/Deep_In_Depth/status...9651147837

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!
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.
Reply
#17
(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.
Please feel free to download and use if you find it useful.

Here are the links:

Github Repo

Video Tutorial

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?
Reply


Forum Jump: