Skip to content

Commit 571546d

Browse files
committed
Updates:
- Update notebooks for recent Colab and Python versions. - Update OD and Semseg documentation. - Deprecate `allocate_inputs` and add new flags. - Log errors for external tools. Signed-off-by: khaoula boutiche <[email protected]>
1 parent 9f6336c commit 571546d

File tree

8 files changed

+601
-1471
lines changed

8 files changed

+601
-1471
lines changed

common/stm32ai_dc/types.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,10 +1098,31 @@ class CliParameters(typing.NamedTuple):
10981098
""" Optional: Compression level. Defaults to "lossless" """
10991099

11001100
allocateInputs: bool = True
1101-
""" When set to true, activations buffer will be also used to handle the input buffers. Defaults to True """
1101+
""" DEPRECATED: Optional: When set to true, activations buffer will be also used to handle the input buffers. Defaults to True """
11021102

11031103
allocateOutputs: bool = True
1104-
""" Optional: When set to true, activations buffer will be also used to handle the output buffers. Defaults to True """
1104+
""" DEPRECATED: Optional: When set to true, activations buffer will be also used to handle the output buffers. Defaults to True """
1105+
1106+
noInputsAllocation: Optional[bool] = None
1107+
""" input buffers must be provided by the application.
1108+
(default: input buffers are stored in a reserved space within the "activations" buffer)
1109+
"""
1110+
1111+
noOutputsAllocation: Optional[bool] = None
1112+
""" output buffers must be provided by the application.
1113+
(default: output buffers are stored in a reserved space within the "activations" buffer)
1114+
"""
1115+
1116+
inputDataType: Optional[str] = None
1117+
""" indicate the expected inputs data type of the generated model
1118+
Multiple inputs: in_data_type_1,in_data_type_2,...
1119+
If one data type is given, it will be applied for all inputs
1120+
"""
1121+
outputDataType: Optional[str] = None
1122+
"""indicate the expected outputs data type of the generated model
1123+
Multiple outputs: out_data_type_1,out_data_type_2,...
1124+
If one data type is given, it will be applied for all outputs
1125+
"""
11051126

11061127
target: Optional[str] = None
11071128
""" Optional: Defines a serie which will be used to calculate more accurate memory footprint. Defaults to "stm32f4" """
@@ -1488,4 +1509,4 @@ def delete_validation_output_file(self, fileName: str):
14881509

14891510
def delete_generated_file(self, fileName: str):
14901511
raise NotImplementedError("delete_generated_file not implemented on \
1491-
this backend")
1512+
this backend")

common/stm32ai_local/compile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,12 @@ def cmd_compile(
208208
logger.info(' target : %s', str(session.board))
209209
logger.info(' options : %s', str(cmd_line[-1]))
210210

211-
err, _ = run_shell_cmd(cmd_line, logger=logger)
211+
err, errorList = run_shell_cmd(cmd_line, logger=logger)
212212

213213
if err != 0:
214-
raise Exception('WRONG!')
214+
for i in range(len(errorList)):
215+
logger.info('%s', str(errorList[i]))
216+
raise Exception('Error during compilation')
215217

216218
# post-process the results
217219
if err == 0:

semantic_segmentation/datasets/pascal_voc_2012/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The augmented dataset increases the number of images and masks to a total of 105
2222

2323
The additional masks can be downloaded from the following Dropbox link:
2424

25-
[Download Additional Masks](https://www.dropbox.com/path/to/masks)
25+
[Download Additional Masks](https://www.dropbox.com/scl/fi/xccys1fus0utdioi7nj4d/SegmentationClassAug.zip?rlkey=0wl8iz6sc40b3qf6nidun4rez&e=3&dl=0)
2626

2727
These masks are integer masks with indices representing different classes. They should be placed in the same directory structure as the original Pascal VOC 2012 dataset.
2828

semantic_segmentation/src/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,8 @@ dataset:
150150
```
151151
The `name` attribute is mandatory. To date, the unique accepted values without the `class_names`: `pascal_voc`, `indoor_pascal_voc`, `person_pascal_voc`, `outdoor_pascal_voc`. However, if using a different dataset and naming convention, the `class_name` attribute should be provided.
152152

153-
**Please follow the [PASCAL VOC 2012 tutorial](../datasets/pascal_voc_2012/README.md) to have more training masks (about 10,582) and a `trainaug.txt` file containing the IDs of the new training masks. Or, the [COCO 2017 PASCAL VOC 2012 tutorial](../datasets/coco_2017_pascal_voc_2012/README.md) to create COCO 2017 + PASCAL VOC 2012 dataset, and the [n_class_coco_2017_pascal_voc_2012 tutorial](../datasets/n_class_coco_2017_pascal_voc_2012/README.md) to create the indoor_pascal_voc, outdoor_pascal_voc, person_pascal_voc dataset.**
154-
155-
---
156-
157153
The `name` attribute is mandatory. To date, a unique value is accepted: `pascal_voc`. This parameter is used in the data_loader in order to correctly construct each dataset expecting [PASCAL VOC 2012](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/) structure. In the future, it could be extended to other dataset types.
158154

159-
**Please follow the [PASCAL VOC 2012 tutorial](../datasets/pascal_voc_2012/README.md) to have more training masks (about 10,582) and a `trainaug.txt` file containing the IDs of the new training masks. Or, the [COCO 2017 PASCAL VOC 2012 tutorial](../datasets/coco_2017_pascal_voc_2012/README.md) to create COCO 2017 + PASCAL VOC 2012 dataset.**
160155

161156
To adhere to the PASCAL VOC 2012 structure, we need to establish three paths for each set. This setup will automatically retrieve the specified images from the training path's JPEG images directory and the corresponding masks from the training masks path.
162157

@@ -168,6 +163,8 @@ the validation set. The `seed` attribute specifies the seed value to use for ran
168163
The 3 quantization path attributes are used to specify a dataset for the quantization process. If these attributes are not provided and a training set is available, the training set is used for the quantization.
169164
However, training sets can be quite large and the quantization process can take a long time to run. To avoid this issue, you can set the `quantization_split` attribute to use only a random portion of the dataset for quantization.
170165

166+
**Please follow the [PASCAL VOC 2012 tutorial](../datasets/pascal_voc_2012/README.md) to have more training masks (about 10,582) and a `trainaug.txt` file containing the IDs of the new training masks. Or, the [COCO 2017 PASCAL VOC 2012 tutorial](../datasets/coco_2017_pascal_voc_2012/README.md) to create COCO 2017 + PASCAL VOC 2012 dataset, and the [n_class_coco_2017_pascal_voc_2012 tutorial](../datasets/n_class_coco_2017_pascal_voc_2012/README.md) to create the indoor_pascal_voc, outdoor_pascal_voc, person_pascal_voc dataset.**
167+
171168
</details></ul>
172169
<ul><details open><summary><a href="#2-4">2.4 Apply image preprocessing</a></summary><a id="2-4"></a>
173170

0 commit comments

Comments
 (0)