Skip to content

Commit 851796a

Browse files
ipa: rpi: controller: awb: Add Neural Network Awb
Add an Awb algorithm which uses neural networks. Signed-off-by: Peter Bailey <[email protected]>
1 parent 36f3d20 commit 851796a

File tree

3 files changed

+554
-0
lines changed

3 files changed

+554
-0
lines changed

meson_options.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,8 @@ option('v4l2',
9191
value : 'auto',
9292
description : 'Compile the V4L2 compatibility layer',
9393
deprecated : {'true': 'enabled', 'false': 'disabled'})
94+
95+
option('rpi_nn_awb',
96+
type : 'feature',
97+
value : 'disabled',
98+
description : 'Enable Raspberry Pi neural network AWB')

src/ipa/rpi/controller/meson.build

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ rpi_ipa_controller_deps = [
3232
libcamera_private,
3333
]
3434

35+
if not get_option('rpi_nn_awb').disabled()
36+
tflite_dep = dependency('tensorflow-lite', required : false)
37+
if not tflite_dep.found()
38+
# This may not have a pkg-config file, so try and find it directly
39+
cc = meson.get_compiler('cpp')
40+
tflite_dep = cc.find_library('tensorflow-lite', required : get_option('rpi_nn_awb'))
41+
endif
42+
43+
if tflite_dep.found()
44+
rpi_ipa_controller_sources += files([
45+
'rpi/awb_nn.cpp',
46+
])
47+
rpi_ipa_controller_deps += tflite_dep
48+
endif
49+
endif
50+
3551
rpi_ipa_controller_lib = static_library('rpi_ipa_controller', rpi_ipa_controller_sources,
3652
include_directories : libipa_includes,
3753
dependencies : rpi_ipa_controller_deps)

0 commit comments

Comments
 (0)