-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMLEyetrack.spec
More file actions
127 lines (111 loc) · 3.12 KB
/
Copy pathMLEyetrack.spec
File metadata and controls
127 lines (111 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# MLEyetrack_fast.spec
# -*- mode: python; coding: utf-8 -*-
FAST_BUILD = True # True = directory build; False = single-file .exe
# 1. Collect everything for these packages in one loop
packages = ['cv2', 'tf2onnx', 'onnxruntime', 'onnxruntime-gpu', 'tensorflow']
datas = []
binaries = []
hiddenimports = []
from PyInstaller.utils.hooks import collect_all
from PyInstaller.building.build_main import Analysis, PYZ, EXE, COLLECT
import os
base_nvidia_path = os.path.join(os.environ.get("CONDA_PREFIX", ""), "Lib", "site-packages", "nvidia")
subdirs = ["cudnn", "cublas", "cuda_runtime", "cufft", "nvjitlink"]
for subdir in subdirs:
bin_path = os.path.join(base_nvidia_path, subdir, "bin")
if os.path.isdir(bin_path):
for dll in os.listdir(bin_path):
if dll.lower().endswith(".dll"):
binaries.append((os.path.join(bin_path, dll), "."))
for _ in range(10):
print()
print("Base nvidia:", base_nvidia_path)
for pkg in packages:
d, b, h = collect_all(pkg)
datas.extend(d)
binaries.extend(b)
hiddenimports.extend(h)
hiddenimports += ['colorama', 'tensorflow']
# How the fuck does python have this much bloat?!?!
# print("\n")
# print(datas)
# print("\n")
# print(binaries)
# print("\n")
# print(hiddenimports)
# print("\n")
for _ in range(10):
print()
block_cipher = None
if FAST_BUILD:
# directory build (no onefile)
print("Making fast build")
a = Analysis(
['MLEyetrack.py'],
pathex=['.'],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
runtime_hooks=['OpenCVPatch.py'],
excludes=[],
noarchive=True,
optimize=0,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name='MLEyetrack',
debug=False,
strip=False,
upx=False,
console=True,
icon='./images/deprivedlogo_transparentandwhitebackground.ico'
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
name='MLEyetrack',
)
else:
# one-file build
print("Making singular .exe build")
import PyInstaller.config
PyInstaller.config.CONF['distpath'] = "./dist/MLEyetrack/"
a = Analysis(
['MLEyetrack.py'],
pathex=['.'],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
runtime_hooks=['OpenCVPatch.py'],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='MLEyetrack',
debug=False,
bootloader_ignore_signals=False,
strip=True,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='./images/deprivedlogo_transparentandwhitebackground.ico'
)