Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more portability for x86_64 environment #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions gimp-plugins/colorpalette.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
baseLoc = os.path.dirname(os.path.realpath(__file__)) + '/'
from gimpfu import *
import sys
sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))

import cv2
import numpy as np
Expand Down
7 changes: 5 additions & 2 deletions gimp-plugins/deblur.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'DeblurGANv2'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'DeblurGANv2'])

import cv2
from predictorClass import Predictor
Expand Down
6 changes: 5 additions & 1 deletion gimp-plugins/deepcolor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
baseLoc = os.path.dirname(os.path.realpath(__file__))+'/'
from gimpfu import *
import sys
sys.path.extend([baseLoc+'gimpenv/lib/python2.7',baseLoc+'gimpenv/lib/python2.7/site-packages',baseLoc+'gimpenv/lib/python2.7/site-packages/setuptools',baseLoc+'ideepcolor'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc+'ideepcolor'])
import numpy as np
import torch
import cv2
Expand Down
10 changes: 6 additions & 4 deletions gimp-plugins/deepdehaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'PyTorch-Image-Dehazing'])

activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'PyTorch-Image-Dehazing'])

import torch
import net
Expand Down Expand Up @@ -84,4 +86,4 @@ def deepdehazing(img, layer, cFlag):
[],
deepdehazing, menu="<Image>/Layer/GIML-ML")

main()
main()
10 changes: 6 additions & 4 deletions gimp-plugins/deepdenoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'PD-Denoising-pytorch'])

activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'PD-Denoising-pytorch'])

from denoiser import *
from argparse import Namespace
Expand Down Expand Up @@ -129,4 +131,4 @@ def deepdenoise(img, layer,cFlag):
[],
deepdenoise, menu="<Image>/Layer/GIML-ML")

main()
main()
7 changes: 5 additions & 2 deletions gimp-plugins/deepmatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'pytorch-deep-image-matting'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'pytorch-deep-image-matting'])

import torch
from argparse import Namespace
Expand Down
9 changes: 6 additions & 3 deletions gimp-plugins/enlighten.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'EnlightenGAN'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'EnlightenGAN'])

from argparse import Namespace
import cv2
Expand Down Expand Up @@ -108,4 +111,4 @@ def Enlighten(img, layer,cFlag):
[],
Enlighten, menu="<Image>/Layer/GIML-ML")

main()
main()
7 changes: 5 additions & 2 deletions gimp-plugins/facegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc+'gimpenv/lib/python2.7',baseLoc+'gimpenv/lib/python2.7/site-packages',baseLoc+'gimpenv/lib/python2.7/site-packages/setuptools',baseLoc+'CelebAMask-HQ/MaskGAN_demo'])

activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc+'CelebAMask-HQ/MaskGAN_demo'])

import torch
from argparse import Namespace
Expand Down
7 changes: 5 additions & 2 deletions gimp-plugins/faceparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'face-parsing-PyTorch'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'face-parsing-PyTorch'])

from model import BiSeNet
from PIL import Image
Expand Down
7 changes: 5 additions & 2 deletions gimp-plugins/inpainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc+'gimpenv/lib/python2.7',baseLoc+'gimpenv/lib/python2.7/site-packages',baseLoc+'gimpenv/lib/python2.7/site-packages/setuptools',baseLoc+'Inpainting'])

activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc+'Inpainting'])

import torch
import numpy as np
Expand Down
7 changes: 5 additions & 2 deletions gimp-plugins/interpolateframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'RIFE'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'RIFE'])

import cv2
import torch
Expand Down
5 changes: 4 additions & 1 deletion gimp-plugins/kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc+'gimpenv/lib/python2.7',baseLoc+'gimpenv/lib/python2.7/site-packages',baseLoc+'gimpenv/lib/python2.7/site-packages/setuptools'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))

import numpy as np
from scipy.cluster.vq import kmeans2
Expand Down
9 changes: 6 additions & 3 deletions gimp-plugins/monodepth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'MiDaS'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'MiDaS'])

from run import run_depth
from monodepth_net import MonoDepthNet
Expand Down Expand Up @@ -74,4 +77,4 @@ def MonoDepth(img, layer,cFlag):
[],
MonoDepth, menu="<Image>/Layer/GIML-ML")

main()
main()
6 changes: 4 additions & 2 deletions gimp-plugins/semseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

from gimpfu import *
import sys
sys.path.extend([baseLoc+'gimpenv/lib/python2.7',baseLoc+'gimpenv/lib/python2.7/site-packages',baseLoc+'gimpenv/lib/python2.7/site-packages/setuptools'])

activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))

from PIL import Image
import torch
Expand Down
7 changes: 5 additions & 2 deletions gimp-plugins/super_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages',
baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'pytorch-SRResNet'])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc + 'pytorch-SRResNet'])

from argparse import Namespace
import torch
Expand Down
7 changes: 6 additions & 1 deletion gimp-plugins/syncWeights.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import requests
import os
baseLoc = os.path.dirname(os.path.realpath(__file__))+'/'
from gimpfu import *
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
import requests

def download_file_from_google_drive(id, destination,fileSize):
URL = "https://docs.google.com/uc?export=download"
Expand Down
6 changes: 5 additions & 1 deletion gimp-plugins/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from gimpfu import *
import sys

sys.path.extend([baseLoc+'gimpenv/lib/python2.7',baseLoc+'gimpenv/lib/python2.7/site-packages',baseLoc+'gimpenv/lib/python2.7/site-packages/setuptools',baseLoc])
activate_this = os.path.join(baseLoc, 'gimpenv', 'bin', 'activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
sys.path.extend([baseLoc])

import shutil
import syncWeights
Expand Down