Hello @milanvdm ,
I did not reproduce your error.
I started from zero and here is what I did so you can follow along:
ST MODEL ZOO INSTALL:
First, I installed ST Model Zoo services doing this:
- git clone https://github.com/STMicroelectronics/stm32ai-modelzoo-services.git
- cd stm32ai-modelzoo-services
- python -m venv st_zoo
- st_zoo\Scripts\activate.bat
- pip install -r requirements.txt
Make sure to use a virtual env as it can be sources of errors.
CREATE A DATASET FROM VOC FORMAT:
Then I took your data which is inside the folder /voc and splitted into /train and /validation.
I copied this folder in /object_detection/datasets/
Then I edited the dataset_config.yaml in dataset_converter:
- Change the format
- Set your class name
- under pascal_voc_format add the path to your training images and xml
- In my case, I want the converted dataset in a folder named "converted_voc"
- run the python script converter.py
dataset:
format: pascal_voc_format
class_names: [vehicle,license_plate]
coco_format:
images_path: ../chess_coco/train
json_annotations_file_path: ../chess_coco/train/_annotations.coco.json
export_dir: subset_chess/train
pascal_voc_format:
images_path: ../voc/train
xml_files_path: ../voc/train
export_dir: ../converted_voc/train
hydra:
run:
dir: outputs/${now:%Y_%m_%d_%H_%M_%S}
(make sure to activate the virtual env before running any command).
With this, you should have in /converted_voc/train jpg files and txt files.
You can do the same for your validation data
Next, we use the create_tfs scripts:
- Go to /dataset_create_tfs and edit the yaml
- Run the python script "dataset_create_tfs.py"
dataset:
dataset_name: test_voc
training_path: ../converted_voc/train
validation_path: ../converted_voc/validation
test_path:
settings:
max_detections: 20
hydra:
run:
dir: outputs/${now:%Y_%m_%d_%H_%M_%S}
Now you should have .tfs files with your jpg and txt files.
USING ST MODEL ZOO
Next is using model zoo:
- Select a model for object detection in model zoo
- I used this one: stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192 at main · STMicroelectronics/stm32ai-modelzoo · GitHub
- Download the .h5 and ssd_mobilenet_v2_fpnlite_035_192_config.yaml
- Copy the .h5 model to /object_detection/pretrained_models
- Copyt the ssd_mobilenet_v2_fpnlite_035_192_config.yaml to /object_detection/src
Then edit the ssd_mobilenet_v2_fpnlite_035_192_config.yaml:
- Change the operation mode to training
- Change the classes with your classes
- Change the data paths
- Run the command: python stm32ai_main.py --config-name ssd_mobilenet_v2_fpnlite_035_192_config.yaml
This should work.
If this worked, you are free to change anything to do what you planned to do.
To use the N6, you will need to download the getting started here:
https://www.st.com/en/development-tools/stm32n6-ai.html
And follow this: https://github.com/STMicroelectronics/stm32ai-modelzoo-services/blob/main/object_detection/deployment/README_STM32N6.md
Have a good day,
Julian