 Hi, welcome back. This is Alan. At this point, you should already have a basic understanding of the FP AI Vision 1 function pack. Now, let's go deeper. In this video, I will show you more details about memory requirement, memory configurations, buffer placement, etc. First, let's see the memory requirement to run the food recognition application. When integrating a C model generated by the XCube AI tool, the following memory requirements must be considered. The volatile memory or the RAM is used to store the activation buffer and an input buffer. The non-molotile memory or the flash is used to store the weights and biases of the network model. In addition to that, for the computer vision applications, RAM is also used to store various buffers that are used across execution of the image pipeline, such as camera capture and the frame preprocessing. So, one next feature of our SCM32H747I Discovery board for these applications is that it supports both internal and external memory. This is the same execution flow we have seen in the previous slide, but with corresponding RAM data buffers. As you can see, each step in the flow uses different buffers. Activation buffer is used during inference to store the temporary results of the intermediate layers within the neural network. And its size depends on the neural network model used. The input buffer is used to hold the input data of the neural network. And the in and output buffer is used to store the classification results. So, to meet the requirements, the user can choose different memory placement configurations. This table shows the RAM data buffer size required by the food recognition application, with both float and the quantize model, and also VGA or QVGA resolution. As shown here, using VGA resolution of the camera requires more memory than using QVGA, and the float model requires more memory than the quantize model. For example, if we use the float model, we have 588 kilobytes for the in and input buffer, and 395 kilobytes for the activation buffer. Please remember these numbers, we will refer to them later. This table shows the internal SRAM memory map of the SDM32H747XI microcontroller. It features about 1MB of internal SRAM. However, it is important to note that this 1MB is not contiguous memory space. The largest block of SRAM is the AXI SRAM, which has a size of 512 kilobytes. But, the in input buffer must be placed in the continuous areas of memory. This is the same for the activation buffer. So, if either the in input buffer or the activation buffer is larger than 512 kilobytes, the generated Z-model is not able to execute by relying only on the internal SRAM. In this case, additional external data RAM is required. So, if you recall the numbers we have seen in the previous slide, the float Z-model implementation does not fit completely into the internal SRAM. Whatever the camera resolution is selected, some external RAM is required in order to run this use case. In the context of the FPEI Vision 1 function pack, the two following memory layouts are implemented. One is full external to place all the buffers in the external RAM, or split external internal to place activation buffers in the internal SRAM, and the other buffers in the external RAM. One thing to note here, there is a great feature in XCube AI called Use Activation Buffer for Input Buffer. If you enable this feature, the in input buffer will be included in the activation buffer to save more memory space. These memory usage figures are obtained from XCube AI 2, which show the difference when the Use Activation Buffer for Input Buffer feature is enabled or not. One thing to note here, now I am using the Quantize the model. In the figures, the green bar represents the input buffer, and the sign bar represents the activation buffer. On the left, we have the feature is disabled, the total size here is activation buffer plus the input buffer, about 250 kilobytes. While on the right side, we have the feature enabled, the size reduced to around 150 kilobytes. Another thing to note, when you enable this feature, depending on the size of activation and input, the buffer size will be determined by the larger one. What about the implementation of the Quantize the C-Model? If the VGA camera resolution is selected, it's the same as Float C-Model, but choosing one scheme or the other comes down to the following trade-offs. One, release as much internal SRAM as possible so that it's available for other user applications that require a significant amount of internal SRAM. And two, reduce the inference time by having the working buffer allocated in faster memory, such as the internal SRAM. If the QVGA camera resolution is selected, the implementation fits completely into the internal SRAM and no external RAM is required. For this configuration, we have two optimizing schemes, one is to optimize the memory and the other one is to optimize the performance. About the flash memory, the XCube AI code generator generates a table containing the weights and the biases. By default, they are stored into the internal flash memory, but there are use cases where the table of weights and biases does not fit into the internal flash memory. For example, the SCM32H747XI microcontroller has two megabytes of flash shared between read-only data and code. In such a situation, the user has the possibility to store the weight and bias table in the external flash memory. As I mentioned, the SCM32H747I discovery board has a serial external flash that is interfaced to the SCM32H747XI microcontroller via the code SPI. This function pack provides examples of how to do that and I will show you a hands-on example as a quick start guide in another video. Here is a list of the banners that included in the function pack. They cover all the combinations including float or quantize model, VGA or QVGA, different RAM schemes and different flash schemes. You can find the desired combination by the file name, which I will explain in the next slide. Here is the explanation of the file name. Let's take this dot hex binary as an example. To have a better visualization, I colored different parts and coded them into letter U to Z. So, all the files begin with the SCM32H747XI disco with six parts behind. The red or U corresponds to the application name, float for foot recognition and person for person detection. The magenta or V corresponds to the model type, STD for standard model, OPT for optimized model. The cyan or W corresponds to the data representation of the model type, which is either float or quantized. The yellow or X corresponds to the data placement scheme in the volatile memory, which is either EXT for external SD RAM, split for splitting between internal SRAM and external SD RAM, IntMAM for internal SRAM with memory optimized, and IntFPS for internal SRAM with FPS optimized. The green or Y corresponds to the configurations for the non-multi-data memory allocation. Int flash for internal flash memory, QSPF flash for external QSPF flash, or EXT SD RAM for external SD RAM. And the last one, purple or Z corresponds to the version number of the function pack release. Thank you for taking your time to watch this video. In the next video, we will go over the performance and memory footprint of the foot recognition application. See you in the next video.