-
Notifications
You must be signed in to change notification settings - Fork 492
/
config.py
55 lines (43 loc) · 1.79 KB
/
config.py
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
from jetson_containers import CUDA_VERSION, CUDA_ARCHITECTURES
from packaging.version import Version
def opencv(version, requires=None, default=False, url=None):
cv = package.copy()
cv['build_args'] = {
'OPENCV_VERSION': version,
'OPENCV_PYTHON': f"{version.split('.')[0]}.x",
'CUDA_ARCH_BIN': ','.join([f'{x/10:.1f}' for x in CUDA_ARCHITECTURES]),
}
if url:
cv['build_args']['OPENCV_URL'] = url
cv['name'] = f'opencv:{version}-deb'
cv['alias'] = ['opencv:deb']
else:
cv['name'] = f'opencv:{version}'
if requires:
cv['requires'] = requires
builder = cv.copy()
builder['name'] = builder['name'] + '-builder'
builder['build_args'] = {**builder['build_args'], 'FORCE_BUILD': 'on'}
meta = cv.copy()
meta['name'] = meta['name'] + '-meta'
meta['depends'] = [cv['name']]
meta['dockerfile'] = 'Dockerfile.meta'
if default:
cv['alias'] = cv.get('alias', []) + ['opencv']
meta['alias'] = 'opencv:meta'
builder['alias'] = 'opencv:builder'
if url:
return cv
else:
return cv, builder, meta
package = [
# JetPack 5/6
opencv('4.5.0', '==35.*', default=False),
opencv('4.8.1', '>=35', default=(CUDA_VERSION <= Version('12.2'))),
opencv('4.10.0', '>=35', default=(CUDA_VERSION > Version('12.2'))),
# JetPack 4
opencv('4.5.0', '==32.*', default=True, url='https://nvidia.box.com/shared/static/5v89u6g5rb62fpz4lh0rz531ajo2t5ef.gz'),
# Debians (c++)
opencv('4.5.0', '==35.*', default=False, url='https://nvidia.box.com/shared/static/2hssa5g3v28ozvo3tc3qwxmn78yerca9.gz'),
opencv('4.8.1', '==36.*', default=False, url='https://nvidia.box.com/shared/static/ngp26xb9hb7dqbu6pbs7cs9flztmqwg0.gz'),
]