File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 1414import numpy as np
1515from PIL import Image
1616
17- try :
18- # If the Jacinle library (https://github.com/vacancy/Jacinle) is present, use its auto_travis feature.
19- from jacinle .jit .cext import auto_travis
20- auto_travis (__file__ , required_files = ['*.so' ])
21- except ImportError as e :
17+
18+ import os
19+ if os .name != "nt" :
2220 # Otherwise, fall back to the subprocess.
2321 import subprocess
2422 print ('Compiling and loading c extensions from "{}".' .format (osp .realpath (osp .dirname (__file__ ))))
25- subprocess .check_call (['./travis.sh' ], cwd = osp .dirname (__file__ ))
23+ # subprocess.check_call(['./travis.sh'], cwd=osp.dirname(__file__))
24+ subprocess .check_call ("make clean && make" , cwd = osp .dirname (__file__ ), shell = True )
2625
2726
2827__all__ = ['set_random_seed' , 'set_verbose' , 'inpaint' , 'inpaint_regularity' ]
@@ -43,8 +42,12 @@ class CMatT(ctypes.Structure):
4342 ('dtype' , ctypes .c_int )
4443 ]
4544
46-
47- PMLIB = ctypes .CDLL (osp .join (osp .dirname (__file__ ), 'libpatchmatch.so' ))
45+ if os .name != "nt" :
46+ PMLIB = ctypes .CDLL (osp .join (osp .dirname (__file__ ), 'libpatchmatch.so' ))
47+ else :
48+ if not os .path .exists (osp .join (osp .dirname (__file__ ), 'libpatchmatch.dll' )):
49+ pass
50+ PMLIB = ctypes .CDLL (osp .join (osp .dirname (__file__ ), 'libpatchmatch.dll' ))
4851
4952PMLIB .PM_set_random_seed .argtypes = [ctypes .c_uint ]
5053PMLIB .PM_set_verbose .argtypes = [ctypes .c_int ]
You can’t perform that action at this time.
0 commit comments