Somehow I logged in differently this is still @rocksetta.
This seems very wrong. @louis, I am struggling with how to get the out_ptr into the features_signal structure. This is what I have tried so far, seems very wasteful of memory. It does compile but flashes red on loading to the Portenta.
int myCamResult = myCam.grab(sdram_frame_buffer); // myCamResult should be zero
// the features are stored into flash, and we don't want to load everything into RAM
signal_t features_signal;
features_signal.total_length = CUTOUT_COLS * CUTOUT_ROWS;
float model_input_buffer[features_signal.total_length];
//features_signal.get_data = &cutout_get_data; // this activated the old code
// somehow activate resize???
// void image_resize_linear(uint8_t *dst_image, uint8_t *src_image, int dst_w, int dst_h, int dst_c, int src_w, int src_h)
uint8_t * tmp_buffer = (uint8_t *) malloc(features_signal.total_length);
image_resize_linear( tmp_buffer, sdram_frame_buffer, 96,96, 1 /* 1 = GRAYSCALE */, 320,320 );
// convert int_8 to float
for (int i=0; i < features_signal.total_length; i++){
model_input_buffer[i] = tmp_buffer[i] / 255.0f;
}
features_signal.get_data((unsigned int)sizeof(uint8_t), (unsigned int)features_signal.total_length, model_input_buffer);
free(tmp_buffer);
I just checked how I did the project using the ESP32 Cam to see if there was any differences, in fact, the way I did allocated the pointer using Espressif SDK was using this function dl_matrix3du_alloc âŚ
This will be different with the Portenta.
/**
* @brief Resize the image in RGB888 format via bilinear interpolation
*
* @param dst_image The output image
* @param src_image Source image
* @param dst_w Width of the output image
* @param dst_h Height of the output image
* @param dst_c Channel of the output image
* @param src_w Width of the source image
* @param src_h Height of the source image
*/
void image_resize_linear(uint8_t *dst_image, uint8_t *src_image, int dst_w, int dst_h, int dst_c, int src_w, int src_h);
It has to be in RGB888 format to use this function⌠I might have misread your initial question.
If needed, here is an arduino sketch I wrote to show how it works with the ESP32 Cam + Edge Impulse
Your amazing @rjames, thanks so much for the code examples. This is the first time I have ever had the Arduino Portenta using all 320x320 camera pixels resized to a 96x96 Edge Impulse model, using the SDRAM of the Portenta for the camera buffer.
Raul @rjames, any hints about testing multi-object âbounding boxes object detectionâ instead of what we have working for single object âone label per dataâ ?
I know from my work with WASM that the differences between the two types of code are very small. I am wondering if this line still grabs the result correctly
EI_IMPULSE_ERROR res = run_classifier(&signal, &result, false /* debug */);
Also
the result structure has changed for multi-object, but I canât find any information about the new structure other than the header file ei_classifier_types.h. I think from my WASM the calls look something like this.
Any confirmation here. Not expecting bounding boxes to work well, just wondering if it works at all on the Portenta. It was very slow on the web browser.