增加模块;增加主调用命令
This commit is contained in:
267
main.spec
Normal file
267
main.spec
Normal file
@ -0,0 +1,267 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
# 隐藏导入列表 - 包含所有可能需要的模块
|
||||
hidden_imports = [
|
||||
# 核心科学计算库
|
||||
'numpy',
|
||||
'numpy.core',
|
||||
'numpy.lib',
|
||||
'numpy.linalg',
|
||||
'numpy.fft',
|
||||
'numpy.random',
|
||||
'scipy',
|
||||
'scipy.sparse',
|
||||
'scipy.optimize',
|
||||
'scipy.integrate',
|
||||
'scipy.signal',
|
||||
'scipy.ndimage',
|
||||
'scipy.stats',
|
||||
'pandas',
|
||||
'pandas.core',
|
||||
'pandas.io',
|
||||
'pandas.plotting',
|
||||
|
||||
# 机器学习库
|
||||
'sklearn',
|
||||
'sklearn.ensemble',
|
||||
'sklearn.tree',
|
||||
'sklearn.svm',
|
||||
'sklearn.linear_model',
|
||||
'sklearn.cluster',
|
||||
'sklearn.decomposition',
|
||||
'sklearn.preprocessing',
|
||||
'sklearn.metrics',
|
||||
'sklearn.model_selection',
|
||||
'sklearn.neighbors',
|
||||
'sklearn.naive_bayes',
|
||||
'sklearn.gaussian_process',
|
||||
'sklearn.discriminant_analysis',
|
||||
'sklearn.neural_network',
|
||||
|
||||
# XGBoost
|
||||
'xgboost',
|
||||
'xgboost.core',
|
||||
'xgboost.sklearn',
|
||||
|
||||
# LightGBM
|
||||
'lightgbm',
|
||||
'lightgbm.basic',
|
||||
'lightgbm.sklearn',
|
||||
|
||||
# 图像处理库
|
||||
'cv2',
|
||||
'PIL',
|
||||
'PIL.Image',
|
||||
'PIL.ImageFilter',
|
||||
'PIL.ImageOps',
|
||||
'skimage',
|
||||
'skimage.io',
|
||||
'skimage.filters',
|
||||
'skimage.morphology',
|
||||
'skimage.transform',
|
||||
'skimage.color',
|
||||
'skimage.exposure',
|
||||
'skimage.measure',
|
||||
'skimage.segmentation',
|
||||
|
||||
# 可视化库
|
||||
'matplotlib',
|
||||
'matplotlib.pyplot',
|
||||
'matplotlib.backends',
|
||||
'matplotlib.backends.backend_agg',
|
||||
'matplotlib.figure',
|
||||
'seaborn',
|
||||
|
||||
# 光谱处理库
|
||||
'spectral',
|
||||
'spectral.io',
|
||||
'spectral.algorithms',
|
||||
|
||||
# 颜色科学库
|
||||
'colour',
|
||||
'colour.models',
|
||||
'colour.difference',
|
||||
|
||||
# 其他工具库
|
||||
'joblib',
|
||||
'tqdm',
|
||||
'tqdm.std',
|
||||
'tqdm.auto',
|
||||
|
||||
# 系统和标准库
|
||||
'pathlib',
|
||||
'argparse',
|
||||
'subprocess',
|
||||
'multiprocessing',
|
||||
'concurrent',
|
||||
'concurrent.futures',
|
||||
'threading',
|
||||
'queue',
|
||||
'collections',
|
||||
'itertools',
|
||||
'functools',
|
||||
'operator',
|
||||
'math',
|
||||
'random',
|
||||
'json',
|
||||
'csv',
|
||||
'pickle',
|
||||
'gzip',
|
||||
'zipfile',
|
||||
'tarfile',
|
||||
'io',
|
||||
'os',
|
||||
'sys',
|
||||
'platform',
|
||||
'warnings',
|
||||
'logging',
|
||||
'traceback',
|
||||
'time',
|
||||
'datetime',
|
||||
're',
|
||||
'glob',
|
||||
'fnmatch',
|
||||
'linecache',
|
||||
'tokenize',
|
||||
'keyword',
|
||||
'ast',
|
||||
'inspect',
|
||||
'dis',
|
||||
'importlib',
|
||||
'importlib.util',
|
||||
'pkgutil',
|
||||
'runpy',
|
||||
'contextlib',
|
||||
'weakref',
|
||||
'gc',
|
||||
'copy',
|
||||
'pprint',
|
||||
'reprlib',
|
||||
'enum',
|
||||
'numbers',
|
||||
'decimal',
|
||||
'fractions',
|
||||
'statistics',
|
||||
'unittest',
|
||||
|
||||
# 动态导入的模块
|
||||
'registry',
|
||||
'validators',
|
||||
'output_handler',
|
||||
|
||||
# 各方法模块
|
||||
'Anomaly_method',
|
||||
'classfication_method',
|
||||
'cluster_method',
|
||||
'color_method',
|
||||
'Dimensionality_Reduction_method',
|
||||
'edge_detect_method',
|
||||
'Feature_Selection_method',
|
||||
'fliter_method',
|
||||
'preprocessing_method',
|
||||
'prosail_method',
|
||||
'rgression_method',
|
||||
'segment_method',
|
||||
'spatial_features_method',
|
||||
'spectral_feature_method',
|
||||
'supervize_cluster_method',
|
||||
|
||||
# 具体的实现文件
|
||||
'Anomaly_method.Covariance',
|
||||
'Anomaly_method.One_Class_SVM',
|
||||
'Anomaly_method.RX',
|
||||
'Anomaly_method.squared_loss_probability',
|
||||
'classfication_method.bil2png',
|
||||
'classfication_method.classfication',
|
||||
'cluster_method.cluster',
|
||||
'color_method.DeltaE',
|
||||
'color_method.spectral2cie2',
|
||||
'color_method.XYZ2RGB',
|
||||
'Dimensionality_Reduction_method.dimensionality_reduction',
|
||||
'edge_detect_method.edge_detect',
|
||||
'Feature_Selection_method.batch_feature_selection',
|
||||
'Feature_Selection_method.Cars',
|
||||
'Feature_Selection_method.feture_select',
|
||||
'Feature_Selection_method.GA',
|
||||
'Feature_Selection_method.Lar',
|
||||
'Feature_Selection_method.random_fog',
|
||||
'Feature_Selection_method.ReliefF',
|
||||
'Feature_Selection_method.sipls',
|
||||
'Feature_Selection_method.Spa',
|
||||
'Feature_Selection_method.Uve',
|
||||
'fliter_method.morphological_fliter',
|
||||
'fliter_method.Smooth_filter',
|
||||
'preprocessing_method.plot',
|
||||
'preprocessing_method.Preprocessing',
|
||||
'prosail_method.prosail_gui',
|
||||
'rgression_method.regression_predict',
|
||||
'rgression_method.regression',
|
||||
'segment_method.threshold_Segment',
|
||||
'spatial_features_method.get_glcm',
|
||||
'spatial_features_method.glcm',
|
||||
'spatial_features_method.plot',
|
||||
'spatial_features_method.shape_feature',
|
||||
'spectral_feature_method.spectral_index',
|
||||
'supervize_cluster_method.supervize_cluster',
|
||||
]
|
||||
|
||||
# 需要排除的模块(减少包大小)
|
||||
excludes = [
|
||||
'pdb', # 调试器
|
||||
'test', # 测试模块
|
||||
'tests', # 测试目录
|
||||
'jupyter', # Jupyter相关
|
||||
'ipykernel', # Jupyter内核
|
||||
'notebook', # Jupyter notebook
|
||||
'IPython', # IPython
|
||||
'zmq', # ZeroMQ
|
||||
'tornado', # Tornado web框架
|
||||
'matplotlib.tests', # matplotlib测试
|
||||
'numpy.tests', # numpy测试
|
||||
'scipy.tests', # scipy测试
|
||||
'pandas.tests', # pandas测试
|
||||
]
|
||||
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[],
|
||||
hiddenimports=hidden_imports,
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=excludes,
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
exclude_binaries=True,
|
||||
name='main',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
name='main',
|
||||
)
|
||||
Reference in New Issue
Block a user