Today we did:
- We continued working on the first project.
Homework:
- Create a new Python file in the same folder as your current file and call it yolo_coco_classes.py. Inside, copy from this link: https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml the classes, and turn it into a dictionary. Call this dictionary coco_classes.
- In the yolo_human_detection.py, remove the if statement for the class check, and right before mapping the x1, y1, etc., make sure to index this dictionary by using the cls variable you had previously. Save it in a variable, you can call it label, for example.
- Then, display this label value in the confidence instead of “Human”. For example, if the label is “Dog” and it detects a dog, it will display “Dog”, and if the label is “Banana” and it detects a banana, it will display “Banana”.
If you have any questions, feel free to email me at joel@ayclogic.com.