Skip to content

Commit dc7fe0f

Browse files
Merge pull request #2310 from madeline-underwood/AI_cam_pipelines_update
Ai cam pipelines update_JA to review
2 parents aaadc93 + 5d9a0be commit dc7fe0f

File tree

6 files changed

+75
-83
lines changed

6 files changed

+75
-83
lines changed

content/learning-paths/mobile-graphics-and-gaming/ai-camera-pipelines/1-prerequisites.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,44 @@ layout: learningpathall
88

99
## Host machine requirements
1010

11-
This Learning Path demonstrates how to improve the performance of camera pipelines using KleidiAI and KleidiCV in applications running on Arm. You will need an Arm64 machine, preferably running an Ubuntu-based distribution. The instructions have been tested on Ubuntu 24.04.
11+
This Learning Path demonstrates how to improve the performance of camera pipelines using KleidiAI and KleidiCV on Arm. You’ll need an Arm64 machine, preferably running an Ubuntu-based distribution. The instructions have been tested on Ubuntu 24.04.
1212

1313
## Install required software
1414

1515
Make sure the following tools are installed:
16-
- `git` - a version control system, for cloning the AI camera pipelines codebase.
17-
- `git lfs` - an extension to `git` for managing large files by storing lightweight references instead of the files themselves.
18-
- `docker` - an open-source containerization platform for running applications in isolated environments.
19-
- `libomp` - LLVM's OpenMP runtime library, required for enabling parallel execution during application performance optimization.
16+
- **Git**version control, for cloning the AI camera pipelines codebase
17+
- **Git LFS**extension to Git for managing large files using lightweight pointers
18+
- **Docker** an open-source container platform for running applications in isolated environments
19+
- **OpenMP runtime (`libomp`)** LLVMs OpenMP runtime library, required for enabling parallel execution during application performance optimization
2020

21-
### git and git lfs
21+
### Git and Git LFS
2222

23-
These tools can be installed by running the following command, depending on your OS:
23+
Install with the commands for your OS:
2424

2525
{{< tabpane code=true >}}
2626
{{< tab header="Linux/Ubuntu" language="bash">}}
27-
sudo apt install git git-lfs -y
27+
sudo apt update
28+
sudo apt install -y git git-lfs
29+
# one-time LFS setup on this machine:
30+
git lfs install
2831
{{< /tab >}}
2932
{{< tab header="macOS" language="bash">}}
3033
brew install git git-lfs
34+
# one-time LFS setup on this machine:
35+
git lfs install
3136
{{< /tab >}}
3237
{{< /tabpane >}}
3338

3439
### Docker
3540

36-
Start by checking that `docker` is installed on your machine by typing the following command line in a terminal:
41+
Check that Docker is installed:
3742

3843
```bash { output_lines="2" }
3944
docker --version
4045
Docker version 27.3.1, build ce12230
4146
```
4247

43-
If you see an error like "`docker: command not found`," then follow the steps from the [Docker Install Guide](https://learn.arm.com/install-guides/docker/).
48+
If you see "`docker: command not found`," follow the [Docker Install Guide](https://learn.arm.com/install-guides/docker/).
4449

4550
{{% notice Note %}}
4651
You might need to log in again or restart your machine for the changes to take effect.
Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,71 @@
11
---
2-
32
title: Overview
43
weight: 4
54

65
### FIXED, DO NOT MODIFY
76
layout: learningpathall
8-
97
---
108

119
## KleidiAI
1210

13-
[KleidiAI](https://gitlab.arm.com/kleidi/kleidiai) is an open-source library that provides optimized, performance-critical routines - also known as micro-kernels - for artificial intelligence (AI) workloads on Arm CPUs.
11+
[KleidiAI](https://gitlab.arm.com/kleidi/kleidiai) is an open-source library of optimized, performance-critical routines (micro-kernels) for AI workloads on Arm CPUs. These routines are tuned for specific Arm microarchitectures to maximize performance and are designed for straightforward integration into C/C++ ML and AI frameworks.
1412

15-
These routines are tuned to take full advantage of specific Arm hardware architectures to maximize performance. The [KleidiAI](https://gitlab.arm.com/kleidi/kleidiai) library is designed for easy integration into C or C++ machine learning (ML) and AI frameworks.
16-
17-
Several popular AI frameworks already take advantage of [KleidiAI](https://gitlab.arm.com/kleidi/kleidiai) to improve performance on Arm platforms.
13+
Several popular AI frameworks already take advantage of KleidiAI to improve performance on Arm platforms.
1814

1915
## KleidiCV
2016

21-
[KleidiCV](https://gitlab.arm.com/kleidi/kleidicv) is an open-source library that provides high-performance image processing functions for AArch64.
22-
23-
It is designed to be lightweight and simple to integrate into a wide variety of projects. Some computer vision frameworks, such as OpenCV, leverage [KleidiCV](https://gitlab.arm.com/kleidi/kleidicv) to accelerate image processing on Arm devices.
17+
[KleidiCV](https://gitlab.arm.com/kleidi/kleidicv) is an open-source library that provides high-performance image-processing functions for AArch64. It is lightweight and simple to integrate, and computer-vision frameworks such as OpenCV can leverage KleidiCV to accelerate image processing on Arm devices.
2418

2519
## AI camera pipelines
2620

2721
This Learning Path provides three example applications that combine AI and computer vision (CV) techniques:
28-
- Background Blur,
29-
- Low-Light Enhancement,
30-
- Neural Denoising.
3122

32-
## Background Blur and Low Light Enhancement
23+
- Background blur
24+
- Low-light enhancement (LLE)
25+
- Neural denoising
3326

34-
Both applications:
35-
- Use input and output images that are stored in `png` format, with three RGB channels (Red, Green, and Blue). Each channel supports 256 intensity levels (0-255) commonly referred to as `RGB8`.
36-
- Convert the images to the `YUV420` color space for processing.
37-
- Apply the relevant effect (background blur or low-light enhancement).
38-
- Convert the processed images back to `RGB8` and save them as `.png` files.
27+
## Background blur and low-light enhancement
3928

40-
### Background Blur
29+
The applications:
30+
31+
- Use input and output images in **PNG** format with three **RGB** channels (8-bit per channel, often written as **RGB8**)
32+
- Convert images to **YUV 4:2:0** for processing
33+
- Apply the relevant effect (background blur or low-light enhancement)
34+
- Convert the processed images back to **RGB8** and save as **.png**
35+
36+
## Background blur
4137

4238
The background blur pipeline is implemented as follows:
4339

44-
![example image alt-text#center](blur_pipeline.png "Background Blur Pipeline Diagram")
40+
![Background blur pipeline diagram showing RGB8 input, conversion to YUV 4:2:0, blur applied to background mask, and reconversion to RGB8 alt-text#center](blur_pipeline.png "Background blur pipeline")
41+
42+
## Low-light enhancement
4543

46-
### Low Light Enhancement
44+
The low-light enhancement pipeline is adapted from the LiveHDR+ method proposed by Google Research (2017):
4745

48-
The low-light enhancement pipeline is adapted from the LiveHDR+ method originally proposed by Google Research in 2017:
46+
![Low-light enhancement pipeline diagram with burst capture, alignment/merge, coefficient prediction network (LiteRT), tone mapping, and RGB output alt-text#center](lle_pipeline.png "Low-light enhancement pipeline")
4947

50-
![example image alt-text#center](lle_pipeline.png "Low-Light Enhancement Pipeline Diagram")
48+
The low-resolution coefficient-prediction network (implemented with LiteRT) performs operations such as:
5149

52-
The Low-Resolution Coefficient Prediction Network (implemented with LiteRT) performs computations such as:
53-
- Strided convolutions.
54-
- Local feature extraction using convolutional layers.
55-
- Global feature extraction using convolutional and fully connected layers.
56-
- Add, convolve, and reshape operations.
50+
- Strided convolutions
51+
- Local feature extraction using convolutional layers
52+
- Global feature extraction using convolutional and fully connected layers
53+
- Add, convolve, and reshape ops
5754

58-
## Neural Denoising
55+
## Neural denoising
5956

60-
Every smartphone photographer has seen it: images that look sharp in daylight
61-
but fall apart in dim lighting. This is because _signal-to-noise ratio (SNR)_
62-
drops dramatically when sensors capture fewer photons. At 1000 lux, the signal
63-
dominates and images look clean; at 1 lux, readout noise becomes visible as
64-
grain, color speckles, and loss of fine detail.
57+
Every smartphone photographer has experienced it: images that look sharp in daylight but degrade in dim lighting. This is because **signal-to-noise ratio (SNR)** drops sharply when sensors capture fewer photons. At 1000 lux, the signal dominates and images look clean; at 1 lux, readout noise becomes visible as grain, color speckling, and loss of fine detail.
6558

66-
That’s why _neural camera denoising_ is one of the most critical --- and
67-
computationally demanding --- steps in a camera pipeline. Done well, it
68-
transforms noisy frames into sharp, vibrant captures. Done poorly, it leaves
69-
smudges and artifacts that ruin the shot.
59+
That’s why **neural camera denoising** is a critical, computationally-demanding, stage in modern camera pipelines. Done well, it can transform noisy frames into sharp, vibrant captures; done poorly, it leaves smudges and artifacts.
7060

71-
As depicted in the diagram below, the Neural Denoising pipeline is using 2
72-
algorithms to process the frames:
73-
- either temporally, with an algorithm named `ultralite` in the code
74-
repository,
75-
- or spatially, with an algorithm named `collapsenet` in the code repository,
76-
- or both.
61+
As shown below, the neural-denoising pipeline uses two algorithms:
7762

78-
Temporal denoising uses some frames as history.
63+
- **Temporal** denoising, `ultralite` in the repository (uses a history of previous frames)
64+
- **Spatial** denoising, `collapsenet` in the repository
65+
- Or a combination of both
7966

80-
![example image alt-text#center](denoising_pipeline.png "Neural Denoising Pipeline Diagram")
67+
![Neural denoising pipeline diagram showing temporal path (with frame history) and spatial path, followed by fusion and output alt-text#center](denoising_pipeline.png "Neural denoising pipeline")
8168

8269
The Neural Denoising application works on frames, as emitted by a camera sensor in Bayer format:
83-
- the input frames are in RGGB 1080x1920x4 format,
84-
- the output frames in YGGV 4x1080x1920 format.
70+
- The input frames are in RGGB 1080x1920x4 format
71+
- The output frames in YGGV 4x1080x1920 format

content/learning-paths/mobile-graphics-and-gaming/ai-camera-pipelines/3-build.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 5
66
layout: learningpathall
77
---
88

9-
## Download the AI Camera Pipelines Project
9+
## Download the AI camera pipelines project
1010

1111
Clone the project repository:
1212

@@ -33,7 +33,7 @@ docker build -t ai-camera-pipelines -f docker/Dockerfile \
3333
docker/
3434
```
3535

36-
## Build the AI Camera Pipelines
36+
## Build the AI camera pipelines
3737

3838
Start a shell in the container you just built:
3939

@@ -46,7 +46,6 @@ Inside the container, run the following commands:
4646
```bash
4747
ENABLE_SME2=0
4848
TENSORFLOW_GIT_TAG="v2.19.0"
49-
5049
# Build flatbuffers
5150
git clone https://github.com/google/flatbuffers.git
5251
cd flatbuffers
@@ -72,11 +71,11 @@ tar cfz example/install.tar.gz install
7271

7372
Leave the container by pressing `Ctrl+D`.
7473

75-
## Notes on the cmake configuration options
74+
## Notes on the CMake configuration options
7675

77-
The `cmake` command line options relevant to this learning path are:
76+
The `cmake` command-line options relevant to this learning path are:
7877

79-
| Command line option | Description |
78+
| Command-line option | Description |
8079
|-------------------------------------|----------------------------------------------------------------------------------------------|
8180
| `ENABLE_SME2=$ENABLE_SME2` | SME2 (Scalable Matrix Extension 2) is disabled in this build with `ENABLE_SME2=0`. |
8281
| `ARMNN_TFLITE_PARSER=0` | Configures the `ai-camera-pipelines` repository to use LiteRT with XNNPack instead of ArmNN. |
@@ -91,7 +90,7 @@ tar xfz ai-camera-pipelines.git/install.tar.gz
9190
mv install ai-camera-pipelines
9291
```
9392

94-
## Diving further in the AI camera pipelines
93+
## Dive deeper into the AI camera pipelines
9594

9695
The AI camera pipelines
9796
[repository](https://git.gitlab.arm.com/kleidi/kleidi-examples/ai-camera-pipelines)

content/learning-paths/mobile-graphics-and-gaming/ai-camera-pipelines/4-run.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ python3 -m venv venv
1919
pip install -r ai-camera-pipelines.git/docker/python-requirements.txt
2020
```
2121

22-
### Background Blur
22+
## Background blur
2323

2424
Run the background Blur pipeline, using `resources/test_input.png` as the input image and write the transformed image to `test_output.png`:
2525

@@ -31,7 +31,7 @@ bin/cinematic_mode resources/test_input.png test_output.png resources/depth_and_
3131
![example image alt-text#center](test_input2.png "Input image")
3232
![example image alt-text#center](test_output2.png "Image with blur applied")
3333

34-
### Low-Light Enhancement
34+
## Low-Light Enhancement
3535

3636
Run the Low-Light Enhancement pipeline, using `resources/test_input.png` as the input image and write the transformed image to `test_output2_lime.png`:
3737

@@ -55,9 +55,9 @@ will become available very soon:
5555
```
5656

5757
The input frames are:
58-
- first converted from `.png` files in the `resources/test-lab-sequence/` directory to the sensor format (RGGB Bayer) into `neural_denoiser_io/input_noisy*`,
59-
- those frames are then processed by the Neural Denoiser and written into `neural_denoiser_io/output_denoised*`,
60-
- last, the denoised frames are converted back to `.png` for easy visualization in directory `test-lab-sequence-out`.
58+
- first converted from `.png` files in the `resources/test-lab-sequence/` directory to the sensor format (RGGB Bayer) into `neural_denoiser_io/input_noisy*`
59+
- those frames are then processed by the Neural Denoiser and written into `neural_denoiser_io/output_denoised*`
60+
- last, the denoised frames are converted back to `.png` for easy visualization in directory `test-lab-sequence-out`
6161

6262
![example image alt-text#center](denoising_input_0010.png "Original frame")
6363
![example image alt-text#center](denoising_output_0010.png "Frame with temporal denoising applied")

content/learning-paths/mobile-graphics-and-gaming/ai-camera-pipelines/5-performances.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ The application you built earlier includes a *benchmark mode* that runs the core
1616

1717
These benchmarks demonstrate the performance improvements enabled by KleidiCV and KleidiAI:
1818
- KleidiCV enhances OpenCV performance with computation kernels optimized for Arm processors.
19-
- KleidiAI accelerates LiteRT + XNNPack inference using AI-optimized micro-kernels tailored for Arm CPUs.
19+
- KleidiAI accelerates LiteRT+XNNPack inference using AI-optimized micro-kernels tailored for Arm CPUs.
2020

21-
## Performances with KleidiCV and KleidiAI
21+
## Performance with KleidiCV and KleidiAI
2222

23-
By default, the OpenCV library is built with KleidiCV support, and LiteRT+xnnpack is built with KleidiAI support.
23+
By default, the OpenCV library is built with KleidiCV support, and LiteRT+XNNPack is built with KleidiAI support.
2424

2525
You can run the benchmarks using the applications you built earlier.
2626

@@ -59,13 +59,13 @@ bin/neural_denoiser_temporal_benchmark_4K 20
5959
The output is similar to:
6060

6161
```output
62-
Total run time over 10 iterations: 37.6839 ms
62+
Total run time over 20 iterations: 37.6839 ms
6363
```
6464

6565
From these results, you can see that:
66-
- `cinematic_mode_benchmark` performed 20 iterations in 2028.745 ms.
67-
- `low_light_image_enhancement_benchmark` performed 20 iterations in 58.2126 ms.
68-
- `neural_denoiser_temporal_benchmark_4K` performed 20 iterations in 37.6839 ms.
66+
- `cinematic_mode_benchmark` performed 20 iterations in 2028.745 ms
67+
- `low_light_image_enhancement_benchmark` performed 20 iterations in 58.2126 ms
68+
- `neural_denoiser_temporal_benchmark_4K` performed 20 iterations in 37.6839 ms
6969

7070
## Benchmark results without KleidiCV and KleidiAI
7171

@@ -112,7 +112,7 @@ The new output is similar to:
112112
Total run time over 20 iterations: 38.0813 ms
113113
```
114114

115-
### Comparison table and future performance uplift with SME2
115+
## Comparison table and future performance uplift with SME2
116116

117117
| Benchmark | Without KleidiCV+KleidiAI | With KleidiCV+KleidiAI |
118118
|-------------------------------------------|---------------------------|------------------------|
@@ -121,7 +121,7 @@ Total run time over 20 iterations: 38.0813 ms
121121
| `neural_denoiser_temporal_benchmark_4K` | 38.0813 ms | 37.6839 ms (-1.04%) |
122122

123123
As shown, the Background Blur (`cinematic_mode_benchmark`) and Neural Denoising
124-
pipelines gains only a minor improvement, while the low-light enhancement pipeline
124+
pipelines gain only a minor improvement, while the low-light enhancement pipeline
125125
sees a minor performance degradation (0.26%) when KleidiCV and KleidiAI are
126126
enabled.
127127

content/learning-paths/mobile-graphics-and-gaming/ai-camera-pipelines/_index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: Accelerate Denoising, Background Blur and Low-Light Camera Effects with K
33

44
minutes_to_complete: 30
55

6-
who_is_this_for: This Learning Path introduces developers to the benefits of optimizing the performance of camera pipelines using KleidiAI and KleidiCV.
6+
who_is_this_for: This introductory topic is for mobile and computer-vision developers, camera pipeline engineers, and performance-minded practitioners who want to optimize real-time camera effects on Arm using KleidiAI and KleidiCV.
77

88
learning_objectives:
9-
- Compile and run AI-powered camera pipeline applications.
10-
- Use KleidiCV and KleidiAI to improve the performance of real-time camera pipelines.
9+
- Build and run AI-powered camera pipeline applications
10+
- Use KleidiCV and KleidiAI to improve the performance of real-time camera pipelines
1111

1212
prerequisites:
13-
- A computer running Arm Linux or macOS with Docker installed.
13+
- A computer running Arm Linux or macOS with Docker installed
1414

1515
author: Arnaud de Grandmaison
1616

@@ -25,6 +25,7 @@ armips:
2525
- Cortex-A
2626
tools_software_languages:
2727
- C++
28+
- Docker
2829
operatingsystems:
2930
- Linux
3031
- macOS

0 commit comments

Comments
 (0)