Skip to content

Commit 9f6336c

Browse files
committed
Updates :
- Fix #1: Issue with the version parsing - Correct the YOLOv8n model paths in the yaml files Signed-off-by: khaoula boutiche <[email protected]>
1 parent 49741c7 commit 9f6336c

File tree

15 files changed

+19
-29
lines changed

15 files changed

+19
-29
lines changed

common/stm32ai_local/stm_ai_tools.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,10 @@ def _get_stm32ai_cli(root_path: Union[str, Path], host_os: str) -> List[Tuple[ST
9898
middlewares = cdt.parent / 'Middlewares'
9999
cmd_line = str(filepath) + ' --version'
100100
err, lines = run_shell_cmd(cmd_line, logger=logger)
101-
pattern_8 = re.compile(r'STM.ai v(\d+\.\d+\.\d+)')
102-
version_8 = pattern_8.findall(lines[0])
103-
pattern_9 = re.compile(r'STM32 MCU module v(\d+\.\d+\.\d+)')
104-
version_9 = pattern_9.findall(lines[1]) if len(lines) > 1 else []
105-
pattern_10= re.compile(r'STM32CubeAI (\d+\.\d+\.\d+)')
106-
version_10 = pattern_10.findall(lines[4]) if len(lines) > 4 else []
107-
if version_8 != []:
108-
version = version_8
109-
elif version_9 != []:
110-
version = version_9
111-
elif version_10 != []:
112-
version = version_10
113-
else:
101+
pattern = re.compile(r'STM32CubeAI (\d+\.\d+\.\d+)')
102+
lines_conc = "".join(lines)
103+
version = pattern.findall(lines_conc)
104+
if version == []:
114105
raise ValueError('Unable to find the CubeAi version')
115106
ver = STMAiVersion(version[0], '{} pack'.format(_X_CUBE_AI_PACK_TAG))
116107
results.append((ver, cdt.parents[idx], cdt))

common/utils/cfg_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from pathlib import Path
1515
import re
1616
import numpy as np
17+
import requests
1718

1819
aspect_ratio_dict = {"fit": "ASPECT_RATIO_FIT",
1920
"crop": "ASPECT_RATIO_CROP",
@@ -23,8 +24,6 @@
2324
color_mode_n6_dict = {"rgb": "COLOR_RGB",
2425
"bgr": "COLOR_BGR"}
2526

26-
27-
import requests
2827

2928

3029
def download_file(url:str, local_path:str):

instance_segmentation/src/benchmarking/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In particular, `operation_mode` should be set to evaluation and the `benchmarkin
1919
general:
2020
project_name: coco_instance_seg
2121
model_type: yolo_v8_seg
22-
model_path: path/to/stm32-hotspot/ultralytics/yolov8n-seg_full_integer_quant_256.tflite
22+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/segmentation/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
2323

2424
operation_mode: benchmarking
2525
```

instance_segmentation/src/config_file_examples/benchmarking_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
general:
22
project_name: coco_instance_seg
33
model_type: yolo_v8_seg
4-
model_path: path/to/stm32-hotspot/ultralytics/yolov8n-seg_full_integer_quant_256.tflite
4+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/segmentation/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
55

66
operation_mode: benchmarking
77

instance_segmentation/src/config_file_examples/deployment_n6_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
general:
22
project_name: coco_instance_seg
33
model_type: yolo_v8_seg
4-
model_path: path/to/stm32-hotspot/ultralytics/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
4+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/segmentation/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
55

66
operation_mode: deployment
77

instance_segmentation/src/config_file_examples/deployment_n6_yolov8n_seg_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
general:
22
model_type: yolo_v8_seg # yolo_v8_seg
33
# path to a `.tflite` or `.onnx` file.
4-
model_path: ../../../stm32ai-modelzoo/instance_segmentation/yolov8n_seg/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
4+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/segmentation/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
55

66
operation_mode: deployment
77

instance_segmentation/src/config_file_examples/prediction_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
general:
22
project_name: coco_instance_seg
33
model_type: yolo_v8_seg
4-
model_path: path/to/stm32-hotspot/ultralytics/yolov8n-seg_full_integer_quant_256.tflite
4+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/segmentation/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
55
display_figures: true
66

77
operation_mode: prediction

instance_segmentation/src/prediction/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The `general` section and its attributes are shown below.
2424
```yaml
2525
general:
2626
project_name: coco_instance_seg # Project name. Optional, defaults to "<unnamed>".
27-
model_path: path/to/stm32-hotspot/ultralytics/yolov8n-seg_full_integer_quant_256.tflite
27+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/segmentation/yolov8n_256_quant_pc_uf_seg_coco-st.tflite
2828
gpu_memory_limit: 16 # Maximum amount of GPU memory in GBytes that TensorFlow may use (an integer).
2929
```
3030

object_detection/src/config_file_examples/deployment_n6_yolov8_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
general:
2-
model_path: https://github.com/stm32-hotspot/ultralytics/blob/main/examples/YOLOv8-STEdgeAI/stedgeai_models/object_detection/yolov8n_256_quant_pc_uf_od_coco-person-st.tflite
2+
model_path: https://github.com/stm32-hotspot/ultralytics/raw/refs/heads/main/examples/YOLOv8-STEdgeAI/stedgeai_models/object_detection/yolov8n_256_quant_pc_uf_od_coco-person-st.tflite
33
model_type: yolo_v8
44
operation_mode: deployment
55

pose_estimation/deployment/README_MPU.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To facilitate the deployment and avoid tools installation, the MPU deployment is
2424

2525
You can use the deployment service by using a model zoo pre-trained model from the [STM32 model zoo](../pretrained_models/README.md) or your own pose estimation model. Please refer to the YAML file [deployment_mpu_config.yaml](../src/config_file_examples/deployment_mpu_config.yaml), which is a ready YAML file with all the necessary sections ready to be filled, or you can update the [user_config.yaml](../src/user_config.yaml) to use it.
2626

27-
As an example, we will show how to deploy the model [yolov8n_256_quant_pt_uf_pose_coco-st.nb.tflite](../path/to/yolov8n_256_quant_pt_uf_pose_coco-st.nb.tflite) pre-trained on the COCO dataset. To use this model, you should first download it from the stm32-hotspot GitHub: https://github.com/stm32-hotspot/ultralytics
27+
As an example, we will show how to deploy the model **yolov8n_256_quant_pt_uf_pose_coco-st.nb.tflite** pre-trained on the COCO dataset. To use this model, you should first download it from the stm32-hotspot GitHub: https://github.com/stm32-hotspot/ultralytics
2828

2929
</details></ul>
3030
</details>

0 commit comments

Comments
 (0)