kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #1628 from coumbsek/feature/FixPathOpenCV
mod: Add post installation fix of OpenCV pathes instead of hot fixingpull/1631/head v3.1.1
commit
2361fce01d
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.1.0
|
3.1.1
|
||||||
|
|
|
@ -59,6 +59,10 @@ Source: "settings.yaml"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "win32env.bat"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "win32env.bat"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "winrun.bat"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "winrun.bat"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "SuperBuild\download\vc_redist.x64.exe"; DestDir: {tmp}; Flags: dontcopy
|
Source: "SuperBuild\download\vc_redist.x64.exe"; DestDir: {tmp}; Flags: dontcopy
|
||||||
|
Source: "winpostinstall.bat"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
|
||||||
|
[Dirs]
|
||||||
|
Name: "{commonappdata}\ODM"; Permissions: users-modify
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: {group}\ODM Console; Filename: "{app}\console.bat"; WorkingDir: "{app}"
|
Name: {group}\ODM Console; Filename: "{app}\console.bat"; WorkingDir: "{app}"
|
||||||
|
@ -69,6 +73,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{tmp}\vc_redist.x64.exe"; StatusMsg: "Installing Visual C++ Redistributable Packages for Visual Studio 2019"; Parameters: "/quiet"; Check: VC2019RedistNeedsInstall ; Flags: waituntilterminated
|
Filename: "{tmp}\vc_redist.x64.exe"; StatusMsg: "Installing Visual C++ Redistributable Packages for Visual Studio 2019"; Parameters: "/quiet"; Check: VC2019RedistNeedsInstall ; Flags: waituntilterminated
|
||||||
|
Filename: "{app}\winpostinstall.bat"; StatusMsg: "Post Install"; Flags: waituntilterminated runhidden
|
||||||
Filename: "{app}\console.bat"; Description: {cm:LaunchProgram,ODM Console}; Flags: nowait postinstall skipifsilent
|
Filename: "{app}\console.bat"; Description: {cm:LaunchProgram,ODM Console}; Flags: nowait postinstall skipifsilent
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
|
|
|
@ -3,11 +3,16 @@ from opendm.net import download
|
||||||
from opendm import log
|
from opendm import log
|
||||||
import zipfile
|
import zipfile
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
def get_model(namespace, url, version, name = "model.onnx"):
|
def get_model(namespace, url, version, name = "model.onnx"):
|
||||||
version = version.replace(".", "_")
|
version = version.replace(".", "_")
|
||||||
|
|
||||||
base_dir = os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")), "storage", "models")
|
base_dir = os.path.join(os.path.dirname(__file__), "..")
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
base_dir = os.path.join(os.getenv('PROGRAMDATA'),"ODM")
|
||||||
|
base_dir = os.path.join(os.path.abspath(base_dir), "storage", "models")
|
||||||
|
|
||||||
namespace_dir = os.path.join(base_dir, namespace)
|
namespace_dir = os.path.join(base_dir, namespace)
|
||||||
versioned_dir = os.path.join(namespace_dir, version)
|
versioned_dir = os.path.join(namespace_dir, version)
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ set GDAL_DRIVER_PATH=%GDALBASE%\gdalplugins
|
||||||
set OSFMBASE=%ODMBASE%SuperBuild\install\bin\opensfm\bin
|
set OSFMBASE=%ODMBASE%SuperBuild\install\bin\opensfm\bin
|
||||||
set SBBIN=%ODMBASE%SuperBuild\install\bin
|
set SBBIN=%ODMBASE%SuperBuild\install\bin
|
||||||
set PDAL_DRIVER_PATH=%ODMBASE%SuperBuild\install\bin
|
set PDAL_DRIVER_PATH=%ODMBASE%SuperBuild\install\bin
|
||||||
|
set PYTHONPYCACHEPREFIX=%PROGRAMDATA%\ODM\pycache
|
||||||
|
|
||||||
set PATH=%GDALBASE%;%SBBIN%;%OSFMBASE%
|
set PATH=%GDALBASE%;%SBBIN%;%OSFMBASE%
|
||||||
set PROJ_LIB=%GDALBASE%\data\proj
|
set PROJ_LIB=%GDALBASE%\data\proj
|
||||||
|
@ -23,14 +24,6 @@ set VIRTUAL_ENV=%ODMBASE%venv
|
||||||
set PYTHONPATH=%VIRTUAL_ENV%
|
set PYTHONPATH=%VIRTUAL_ENV%
|
||||||
set PYENVCFG=%VIRTUAL_ENV%\pyvenv.cfg
|
set PYENVCFG=%VIRTUAL_ENV%\pyvenv.cfg
|
||||||
|
|
||||||
rem Hot-patching pyvenv.cfg
|
|
||||||
echo home = %ODMBASE%venv\Scripts> "%PYENVCFG%"
|
|
||||||
echo include-system-site-packages = false>> "%PYENVCFG%"
|
|
||||||
|
|
||||||
rem Hot-patching cv2 extension configs
|
|
||||||
echo BINARIES_PATHS = [r"%SBBIN%"] + BINARIES_PATHS> venv\Lib\site-packages\cv2\config.py
|
|
||||||
echo PYTHON_EXTENSIONS_PATHS = [r'''%VIRTUAL_ENV%\lib\site-packages\cv2\python-3.8'''] + PYTHON_EXTENSIONS_PATHS> venv\Lib\site-packages\cv2\config-3.8.py
|
|
||||||
|
|
||||||
if not defined PROMPT set PROMPT=$P$G
|
if not defined PROMPT set PROMPT=$P$G
|
||||||
|
|
||||||
if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT%
|
if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT%
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
set ODMBASE=%~dp0
|
||||||
|
set VIRTUAL_ENV=%ODMBASE%venv
|
||||||
|
set PYENVCFG=%VIRTUAL_ENV%\pyvenv.cfg
|
||||||
|
set SBBIN=%ODMBASE%SuperBuild\install\bin
|
||||||
|
|
||||||
|
rem Hot-patching pyvenv.cfg
|
||||||
|
echo home = %ODMBASE%venv\Scripts> "%PYENVCFG%"
|
||||||
|
echo include-system-site-packages = false>> "%PYENVCFG%"
|
||||||
|
|
||||||
|
rem Hot-patching cv2 extension configs
|
||||||
|
echo BINARIES_PATHS = [r"%SBBIN%"] + BINARIES_PATHS> venv\Lib\site-packages\cv2\config.py
|
||||||
|
echo PYTHON_EXTENSIONS_PATHS = [r'''%VIRTUAL_ENV%\lib\site-packages\cv2\python-3.8'''] + PYTHON_EXTENSIONS_PATHS> venv\Lib\site-packages\cv2\config-3.8.py
|
||||||
|
|
||||||
|
cls
|
Ładowanie…
Reference in New Issue