2025-10-12 9:18 AM
Dear STM Community,
I want to run Yolov8 object detection model from ST Model ZOO. I try to change STM32N6-GettingStarted-ObjectDetection from Yolo Tiny to Yolov8. I changed app_config.h:
#define USE_DCACHE
/*Defines: CMW_MIRRORFLIP_NONE; CMW_MIRRORFLIP_FLIP; CMW_MIRRORFLIP_MIRROR; CMW_MIRRORFLIP_FLIP_MIRROR;*/
#define CAMERA_FLIP CMW_MIRRORFLIP_NONE
#define ASPECT_RATIO_MODE ASPECT_RATIO_FIT
/* Model Related Info */
#define POSTPROCESS_TYPE POSTPROCESS_OD_YOLO_V8_UI
#define NN_WIDTH (416)
#define NN_HEIGHT (416)
#define NN_BPP 3
#define COLOR_BGR (0)
#define COLOR_RGB (1)
#define COLOR_MODE COLOR_RGB
/* Classes */
#define NB_CLASSES (1)
#define CLASSES_TABLE const char* classes_table[NB_CLASSES] = {"person"}
/* I/O configuration */
/* Postprocessing YOLO_V8 configuration */
#define AI_OD_YOLOV8_PP_NB_CLASSES (1)
#define AI_OD_YOLOV8_PP_L_GRID_WIDTH (52)
#define AI_OD_YOLOV8_PP_L_GRID_HEIGHT (52)
#define AI_OD_YOLOV8_PP_M_GRID_WIDTH (26)
#define AI_OD_YOLOV8_PP_M_GRID_HEIGHT (26)
#define AI_OD_YOLOV8_PP_S_GRID_WIDTH (13)
#define AI_OD_YOLOV8_PP_S_GRID_HEIGHT (13)
#define AI_OD_YOLO_V8_PP_NB_ANCHORS (3)
#define AI_OD_YOLOV8_PP_IOU_THRESHOLD (0.5)
#define AI_OD_YOLOV8_PP_CONF_THRESHOLD (0.8)
#define AI_OD_YOLOV8_PP_MAX_BOXES_LIMIT (100)
#define AI_OD_YOLOV8_PP_TOTAL_BOXES (50)
I then adjusted the network using ST Edge AI, generating the following files:
network.hex
network.c
network_ecblobs.h
When I run the application on my STM32N6570-DK, I see the live video stream correctly and performance (inference time) is similar to what’s reported in the Model Zoo.
However, I always get 8 bounding boxes drawn in almost the same locations, even when there are no people in the frame.
Could this be due to missing or incorrect image preprocessing before feeding the data into the neural network? Are there additional configuration parameters I might have missed when switching from YOLO Tiny to YOLOv8?
Best regards,
Adam