From ba54dd107cf6937eb2afc17991a78c9e6c05c807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E6=BE=B3?= Date: Thu, 16 Jan 2025 15:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E8=BE=93=E5=87=BA=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E8=BF=9B=E8=A1=8C=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odm_preprocess.spec | 71 ++++++++++++++++++++++++++++++++++++++++++++ tools/convert_jpg.py | 4 +-- tools/read_gps.py | 2 +- utils/odm_monitor.py | 7 +++-- 4 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 odm_preprocess.spec diff --git a/odm_preprocess.spec b/odm_preprocess.spec new file mode 100644 index 0000000..76779e9 --- /dev/null +++ b/odm_preprocess.spec @@ -0,0 +1,71 @@ +# -*- mode: python ; coding: utf-8 -*- +import sys +from PyInstaller.utils.hooks import collect_data_files +import numpy + +block_cipher = None + +# 收集相关文件 +numpy_data = collect_data_files('numpy') +sklearn_data = collect_data_files('sklearn') + +a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[ + (numpy.__path__[0], 'numpy'), + *numpy_data, + *sklearn_data + ], + hiddenimports=[ + 'numpy', + 'numpy.core._methods', + 'numpy.lib.format', + 'numpy.core._multiarray_umath', + 'sklearn', + 'sklearn.neighbors._partition_nodes', + 'sklearn.neighbors._quad_tree', + 'sklearn.utils._cython_blas', + 'sklearn.utils._typedefs', + 'sklearn.utils._heap', + 'sklearn.utils._sorting', + 'sklearn.utils._vector_sentinel', + 'setuptools', + 'setuptools.distutils', + 'setuptools.distutils.version', + 'distutils', + 'distutils.version' + ], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) + +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='odm_preprocess', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) \ No newline at end of file diff --git a/tools/convert_jpg.py b/tools/convert_jpg.py index cefdcbe..584fd9d 100644 --- a/tools/convert_jpg.py +++ b/tools/convert_jpg.py @@ -13,9 +13,9 @@ def convert_image(file_name, img_dir, output_dir, convert_format): img.save(output_path) def main(): - convert_format = "jpg" + convert_format = "png" img_dir = r"E:\datasets\UAV\134\project\images" - output_dir = r"E:\datasets\UAV\134_jpg\project\images" + output_dir = r"E:\datasets\UAV\134_png\project\images" # 如果输出目录存在,先删除 if os.path.exists(output_dir): diff --git a/tools/read_gps.py b/tools/read_gps.py index 47166bf..cf21e68 100644 --- a/tools/read_gps.py +++ b/tools/read_gps.py @@ -56,7 +56,7 @@ def main(): if lat is not None and lon is not None: # 如果没有高度信息,使用0 alt = alt if alt is not None else 0 - filename = filename.replace(".jpg", ".tif") + # filename = filename.replace(".jpg", ".tif") f.write(f"{filename} {lat} {lon} {alt}\n") if __name__ == '__main__': diff --git a/utils/odm_monitor.py b/utils/odm_monitor.py index 96ff3d3..4782423 100644 --- a/utils/odm_monitor.py +++ b/utils/odm_monitor.py @@ -33,8 +33,9 @@ class ODMProcessMonitor: # 根据不同模式检查不同的产品 if self.mode == "快拼模式": # 只检查正射影像 - if not self._check_orthophoto(project_dir): - return False + # if not self._check_orthophoto(project_dir): + # return False + pass elif self.mode == "三维模式": # 检查点云和实景三维 @@ -156,7 +157,7 @@ class ODMProcessMonitor: if use_lowest_quality: docker_command += f"--feature-quality lowest " - docker_command += f"--orthophoto-resolution 8 " + # docker_command += f"--orthophoto-resolution 8 " if produce_dem: docker_command += (