Note that each path described below is under the aitrios-rpi-training-samples-r3 folder.
1) Edit the card_classification.py file
src/imx500_zoo/datasets/card_classification.py
Create an appropriately named copy of this file (e.g., fork_knife_spoon_classification.py).
- Comment out the DOWNLOAD_DATASET definition:
# DOWNLOAD_DATASET = … - Change the data loader class name to an appropriate one
(e.g., CardClassification to ForkKnifeSpoonClassification.) - Comment out the download function
- Change below path so that it points at your data.
• self.data_path in setup() - Delete the following command:
• self.download(self.data_path) in setup()

2) Edit the __init__.py file
src/imx500_zoo/datasets/__init__.py
Edit this file to include the data loader class name:
Example:
from imx500_zoo.datasets.fork_knife_spoon_classification import
ForkKnifeSpoonClassification
3) Edit the mobilenet_v2_card.ini file
samples/mobilenet_v2_card.ini
Create an appropriately named copy of this file (e.g., mobilenet_v2_fork_knife_spoon.ini).
- Change [MODEL] > NUM_CLASSES to show the number of classes.
- Change [DATASET] > NAME to
- Ensure that [TRAINER] > BATCH_SIZE is less than the number of images in each subfolder of your training set.

- Follow the instructions in the section “Running the sample code to create the model” to create the model. Remember to specify the new copy of the .ini file that you created.
- Convert the model as shown in the section “Convert the model”.
- Download the model as shown in the section “Download the files from the VM”
- Upload the model to the camera as shown in “Load the model on to the Triton Smart”. Create a classification.txt that contains the name of the classes you are trying to detect (e.g., knife, fork, spoon).