Message ID | 20221022062310.2545463-10-paul.elder@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Paul, I've not had a chance to fully look through this work yet, so apologies. However, I do have a question - does this script produce identical results when compared with the existing RPi script for a given set of inputs? Regards, Naush On Sat, 22 Oct 2022 at 07:23, Paul Elder via libcamera-devel < libcamera-devel@lists.libcamera.org> wrote: > Add a tuning script for raspberrypi for alsc only, that uses libtuning. > Since there will also be a tuning script for raspberrypi that has more > modules, put the libtuning alsc module definition in a separate file so > that it can be reused later. > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> > > --- > Changes in v2: > - fix python errors > - fix style > - add SPDX and copyright > - s/average_functions/average/ > - update script to work with new raspberrypi alsc module > --- > utils/tuning/raspberrypi/__init__.py | 0 > utils/tuning/raspberrypi/alsc.py | 17 +++++++++++++++++ > utils/tuning/raspberrypi_alsc_only.py | 22 ++++++++++++++++++++++ > 3 files changed, 39 insertions(+) > create mode 100644 utils/tuning/raspberrypi/__init__.py > create mode 100644 utils/tuning/raspberrypi/alsc.py > create mode 100755 utils/tuning/raspberrypi_alsc_only.py > > diff --git a/utils/tuning/raspberrypi/__init__.py > b/utils/tuning/raspberrypi/__init__.py > new file mode 100644 > index 00000000..e69de29b > diff --git a/utils/tuning/raspberrypi/alsc.py > b/utils/tuning/raspberrypi/alsc.py > new file mode 100644 > index 00000000..71ab3995 > --- /dev/null > +++ b/utils/tuning/raspberrypi/alsc.py > @@ -0,0 +1,17 @@ > +# SPDX-License-Identifier: GPL-2.0-or-later > +# > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > + > +import libtuning as lt > +from libtuning.modules.alsc import ALSCRaspberryPi > + > +ALSC = \ > + ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', > lt.Param.Mode.Optional, True), > + luminance_strength=lt.Param('luminance_strength', > lt.Param.Mode.Optional, 0.5), > + debug=[lt.Debug.Plot], > + sector_shape=(16, 12), > + > sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), > + > sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), > + sector_average_function=lt.average.Mean(), > + smoothing_function=lt.smoothing.MedianBlur(3), > + ) > diff --git a/utils/tuning/raspberrypi_alsc_only.py > b/utils/tuning/raspberrypi_alsc_only.py > new file mode 100755 > index 00000000..3cd7b074 > --- /dev/null > +++ b/utils/tuning/raspberrypi_alsc_only.py > @@ -0,0 +1,22 @@ > +#!/usr/bin/env python3 > +# SPDX-License-Identifier: GPL-2.0-or-later > +# > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > +# > +# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only > + > +import sys > + > +import libtuning as lt > +from libtuning.parsers import RaspberryPiParser > +from libtuning.generators import RaspberryPiOutput > + > +from raspberrypi.alsc import ALSC > + > +tuner = lt.Camera('Raspberry Pi (ALSC only)') > +tuner.add(ALSC) > +tuner.setInputType(RaspberryPiParser) > +tuner.setOutputType(RaspberryPiOutput) > +tuner.setOutputOrder([ALSC]) > + > +tuner.run(sys.argv) > -- > 2.30.2 > >
Hello, On Wed, Nov 09, 2022 at 09:39:12AM +0000, Naushir Patuck via libcamera-devel wrote: > Hi Paul, > > I've not had a chance to fully look through this work yet, so apologies. > However, I do have a question - does this script produce identical results > when compared with the existing RPi script for a given set of inputs? Paul told me he compared both, and the results were identical. Not all corner cases may have been tested though. This leads me to another question: how do you test ctt to avoid regressions, do you have a test suite ? > On Sat, 22 Oct 2022 at 07:23, Paul Elder via libcamera-devel wrote: > > > Add a tuning script for raspberrypi for alsc only, that uses libtuning. > > Since there will also be a tuning script for raspberrypi that has more > > modules, put the libtuning alsc module definition in a separate file so > > that it can be reused later. > > > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > Changes in v2: > > - fix python errors > > - fix style > > - add SPDX and copyright > > - s/average_functions/average/ > > - update script to work with new raspberrypi alsc module > > --- > > utils/tuning/raspberrypi/__init__.py | 0 > > utils/tuning/raspberrypi/alsc.py | 17 +++++++++++++++++ > > utils/tuning/raspberrypi_alsc_only.py | 22 ++++++++++++++++++++++ > > 3 files changed, 39 insertions(+) > > create mode 100644 utils/tuning/raspberrypi/__init__.py > > create mode 100644 utils/tuning/raspberrypi/alsc.py > > create mode 100755 utils/tuning/raspberrypi_alsc_only.py > > > > diff --git a/utils/tuning/raspberrypi/__init__.py > > b/utils/tuning/raspberrypi/__init__.py > > new file mode 100644 > > index 00000000..e69de29b > > diff --git a/utils/tuning/raspberrypi/alsc.py > > b/utils/tuning/raspberrypi/alsc.py > > new file mode 100644 > > index 00000000..71ab3995 > > --- /dev/null > > +++ b/utils/tuning/raspberrypi/alsc.py > > @@ -0,0 +1,17 @@ > > +# SPDX-License-Identifier: GPL-2.0-or-later > > +# > > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > > + > > +import libtuning as lt > > +from libtuning.modules.alsc import ALSCRaspberryPi > > + > > +ALSC = \ > > + ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', lt.Param.Mode.Optional, True), > > + luminance_strength=lt.Param('luminance_strength', lt.Param.Mode.Optional, 0.5), > > + debug=[lt.Debug.Plot], > > + sector_shape=(16, 12), > > + sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), > > + sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), > > + sector_average_function=lt.average.Mean(), > > + smoothing_function=lt.smoothing.MedianBlur(3), > > + ) > > diff --git a/utils/tuning/raspberrypi_alsc_only.py > > b/utils/tuning/raspberrypi_alsc_only.py > > new file mode 100755 > > index 00000000..3cd7b074 > > --- /dev/null > > +++ b/utils/tuning/raspberrypi_alsc_only.py > > @@ -0,0 +1,22 @@ > > +#!/usr/bin/env python3 > > +# SPDX-License-Identifier: GPL-2.0-or-later > > +# > > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > > +# > > +# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only > > + > > +import sys > > + > > +import libtuning as lt > > +from libtuning.parsers import RaspberryPiParser > > +from libtuning.generators import RaspberryPiOutput > > + > > +from raspberrypi.alsc import ALSC > > + > > +tuner = lt.Camera('Raspberry Pi (ALSC only)') > > +tuner.add(ALSC) > > +tuner.setInputType(RaspberryPiParser) > > +tuner.setOutputType(RaspberryPiOutput) > > +tuner.setOutputOrder([ALSC]) > > + > > +tuner.run(sys.argv)
Hi Laurent, On Wed, 9 Nov 2022 at 11:21, Laurent Pinchart < laurent.pinchart@ideasonboard.com> wrote: > Hello, > > On Wed, Nov 09, 2022 at 09:39:12AM +0000, Naushir Patuck via > libcamera-devel wrote: > > Hi Paul, > > > > I've not had a chance to fully look through this work yet, so apologies. > > However, I do have a question - does this script produce identical > results > > when compared with the existing RPi script for a given set of inputs? > > Paul told me he compared both, and the results were identical. Not all > corner cases may have been tested though. This leads me to another > question: how do you test ctt to avoid regressions, do you have a test > suite ? > Great, that's what I was expecting. As for our testing, we don't currently have a test suite for the tuning tool. Something to put on the list... Regards, Naush > > > On Sat, 22 Oct 2022 at 07:23, Paul Elder via libcamera-devel wrote: > > > > > Add a tuning script for raspberrypi for alsc only, that uses libtuning. > > > Since there will also be a tuning script for raspberrypi that has more > > > modules, put the libtuning alsc module definition in a separate file so > > > that it can be reused later. > > > > > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > --- > > > Changes in v2: > > > - fix python errors > > > - fix style > > > - add SPDX and copyright > > > - s/average_functions/average/ > > > - update script to work with new raspberrypi alsc module > > > --- > > > utils/tuning/raspberrypi/__init__.py | 0 > > > utils/tuning/raspberrypi/alsc.py | 17 +++++++++++++++++ > > > utils/tuning/raspberrypi_alsc_only.py | 22 ++++++++++++++++++++++ > > > 3 files changed, 39 insertions(+) > > > create mode 100644 utils/tuning/raspberrypi/__init__.py > > > create mode 100644 utils/tuning/raspberrypi/alsc.py > > > create mode 100755 utils/tuning/raspberrypi_alsc_only.py > > > > > > diff --git a/utils/tuning/raspberrypi/__init__.py > > > b/utils/tuning/raspberrypi/__init__.py > > > new file mode 100644 > > > index 00000000..e69de29b > > > diff --git a/utils/tuning/raspberrypi/alsc.py > > > b/utils/tuning/raspberrypi/alsc.py > > > new file mode 100644 > > > index 00000000..71ab3995 > > > --- /dev/null > > > +++ b/utils/tuning/raspberrypi/alsc.py > > > @@ -0,0 +1,17 @@ > > > +# SPDX-License-Identifier: GPL-2.0-or-later > > > +# > > > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > > > + > > > +import libtuning as lt > > > +from libtuning.modules.alsc import ALSCRaspberryPi > > > + > > > +ALSC = \ > > > + ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', > lt.Param.Mode.Optional, True), > > > + luminance_strength=lt.Param('luminance_strength', > lt.Param.Mode.Optional, 0.5), > > > + debug=[lt.Debug.Plot], > > > + sector_shape=(16, 12), > > > + > sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), > > > + > sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), > > > + sector_average_function=lt.average.Mean(), > > > + smoothing_function=lt.smoothing.MedianBlur(3), > > > + ) > > > diff --git a/utils/tuning/raspberrypi_alsc_only.py > > > b/utils/tuning/raspberrypi_alsc_only.py > > > new file mode 100755 > > > index 00000000..3cd7b074 > > > --- /dev/null > > > +++ b/utils/tuning/raspberrypi_alsc_only.py > > > @@ -0,0 +1,22 @@ > > > +#!/usr/bin/env python3 > > > +# SPDX-License-Identifier: GPL-2.0-or-later > > > +# > > > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > > > +# > > > +# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only > > > + > > > +import sys > > > + > > > +import libtuning as lt > > > +from libtuning.parsers import RaspberryPiParser > > > +from libtuning.generators import RaspberryPiOutput > > > + > > > +from raspberrypi.alsc import ALSC > > > + > > > +tuner = lt.Camera('Raspberry Pi (ALSC only)') > > > +tuner.add(ALSC) > > > +tuner.setInputType(RaspberryPiParser) > > > +tuner.setOutputType(RaspberryPiOutput) > > > +tuner.setOutputOrder([ALSC]) > > > + > > > +tuner.run(sys.argv) > > -- > Regards, > > Laurent Pinchart >
On Wed, Nov 09, 2022 at 12:44:01PM +0000, Naushir Patuck wrote: > Hi Laurent, > > > On Wed, 9 Nov 2022 at 11:21, Laurent Pinchart < > laurent.pinchart@ideasonboard.com> wrote: > > Hello, > > On Wed, Nov 09, 2022 at 09:39:12AM +0000, Naushir Patuck via > libcamera-devel wrote: > > Hi Paul, > > > > I've not had a chance to fully look through this work yet, so apologies. > > However, I do have a question - does this script produce identical > results > > when compared with the existing RPi script for a given set of inputs? Yeah it does. I made sure to confirm that. Of course, it's only for ALSC so far. > > Paul told me he compared both, and the results were identical. Not all > corner cases may have been tested though. This leads me to another (Hehe, *corner cases*... because LSC :D) I only tested a couple images and took the output of ctt, and then compared it to the output of this script. That's it. > question: how do you test ctt to avoid regressions, do you have a test > suite ? > > > Great, that's what I was expecting. > > As for our testing, we don't currently have a test suite for the tuning tool. > Something to put on the list... Ah :D I guess comparing the results with the previous version of the script isn't great... Paul > > > > > > On Sat, 22 Oct 2022 at 07:23, Paul Elder via libcamera-devel wrote: > > > > > Add a tuning script for raspberrypi for alsc only, that uses libtuning. > > > Since there will also be a tuning script for raspberrypi that has more > > > modules, put the libtuning alsc module definition in a separate file so > > > that it can be reused later. > > > > > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > --- > > > Changes in v2: > > > - fix python errors > > > - fix style > > > - add SPDX and copyright > > > - s/average_functions/average/ > > > - update script to work with new raspberrypi alsc module > > > --- > > > utils/tuning/raspberrypi/__init__.py | 0 > > > utils/tuning/raspberrypi/alsc.py | 17 +++++++++++++++++ > > > utils/tuning/raspberrypi_alsc_only.py | 22 ++++++++++++++++++++++ > > > 3 files changed, 39 insertions(+) > > > create mode 100644 utils/tuning/raspberrypi/__init__.py > > > create mode 100644 utils/tuning/raspberrypi/alsc.py > > > create mode 100755 utils/tuning/raspberrypi_alsc_only.py > > > > > > diff --git a/utils/tuning/raspberrypi/__init__.py > > > b/utils/tuning/raspberrypi/__init__.py > > > new file mode 100644 > > > index 00000000..e69de29b > > > diff --git a/utils/tuning/raspberrypi/alsc.py > > > b/utils/tuning/raspberrypi/alsc.py > > > new file mode 100644 > > > index 00000000..71ab3995 > > > --- /dev/null > > > +++ b/utils/tuning/raspberrypi/alsc.py > > > @@ -0,0 +1,17 @@ > > > +# SPDX-License-Identifier: GPL-2.0-or-later > > > +# > > > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > > > + > > > +import libtuning as lt > > > +from libtuning.modules.alsc import ALSCRaspberryPi > > > + > > > +ALSC = \ > > > + ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', > lt.Param.Mode.Optional, True), > > > + luminance_strength=lt.Param('luminance_strength', > lt.Param.Mode.Optional, 0.5), > > > + debug=[lt.Debug.Plot], > > > + sector_shape=(16, 12), > > > + sector_x_gradient=lt.gradient.Linear > (lt.Remainder.DistributeFront), > > > + sector_y_gradient=lt.gradient.Linear > (lt.Remainder.DistributeFront), > > > + sector_average_function=lt.average.Mean(), > > > + smoothing_function=lt.smoothing.MedianBlur(3), > > > + ) > > > diff --git a/utils/tuning/raspberrypi_alsc_only.py > > > b/utils/tuning/raspberrypi_alsc_only.py > > > new file mode 100755 > > > index 00000000..3cd7b074 > > > --- /dev/null > > > +++ b/utils/tuning/raspberrypi_alsc_only.py > > > @@ -0,0 +1,22 @@ > > > +#!/usr/bin/env python3 > > > +# SPDX-License-Identifier: GPL-2.0-or-later > > > +# > > > +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> > > > +# > > > +# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only > > > + > > > +import sys > > > + > > > +import libtuning as lt > > > +from libtuning.parsers import RaspberryPiParser > > > +from libtuning.generators import RaspberryPiOutput > > > + > > > +from raspberrypi.alsc import ALSC > > > + > > > +tuner = lt.Camera('Raspberry Pi (ALSC only)') > > > +tuner.add(ALSC) > > > +tuner.setInputType(RaspberryPiParser) > > > +tuner.setOutputType(RaspberryPiOutput) > > > +tuner.setOutputOrder([ALSC]) > > > + > > > +tuner.run(sys.argv)
diff --git a/utils/tuning/raspberrypi/__init__.py b/utils/tuning/raspberrypi/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/utils/tuning/raspberrypi/alsc.py b/utils/tuning/raspberrypi/alsc.py new file mode 100644 index 00000000..71ab3995 --- /dev/null +++ b/utils/tuning/raspberrypi/alsc.py @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> + +import libtuning as lt +from libtuning.modules.alsc import ALSCRaspberryPi + +ALSC = \ + ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', lt.Param.Mode.Optional, True), + luminance_strength=lt.Param('luminance_strength', lt.Param.Mode.Optional, 0.5), + debug=[lt.Debug.Plot], + sector_shape=(16, 12), + sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), + sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), + sector_average_function=lt.average.Mean(), + smoothing_function=lt.smoothing.MedianBlur(3), + ) diff --git a/utils/tuning/raspberrypi_alsc_only.py b/utils/tuning/raspberrypi_alsc_only.py new file mode 100755 index 00000000..3cd7b074 --- /dev/null +++ b/utils/tuning/raspberrypi_alsc_only.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> +# +# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only + +import sys + +import libtuning as lt +from libtuning.parsers import RaspberryPiParser +from libtuning.generators import RaspberryPiOutput + +from raspberrypi.alsc import ALSC + +tuner = lt.Camera('Raspberry Pi (ALSC only)') +tuner.add(ALSC) +tuner.setInputType(RaspberryPiParser) +tuner.setOutputType(RaspberryPiOutput) +tuner.setOutputOrder([ALSC]) + +tuner.run(sys.argv)
Add a tuning script for raspberrypi for alsc only, that uses libtuning. Since there will also be a tuning script for raspberrypi that has more modules, put the libtuning alsc module definition in a separate file so that it can be reused later. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- Changes in v2: - fix python errors - fix style - add SPDX and copyright - s/average_functions/average/ - update script to work with new raspberrypi alsc module --- utils/tuning/raspberrypi/__init__.py | 0 utils/tuning/raspberrypi/alsc.py | 17 +++++++++++++++++ utils/tuning/raspberrypi_alsc_only.py | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 utils/tuning/raspberrypi/__init__.py create mode 100644 utils/tuning/raspberrypi/alsc.py create mode 100755 utils/tuning/raspberrypi_alsc_only.py