15-494/694 Cognitive Robotics: Segmenter Training
- We're going to use the YOLO26 segmenter from Ultralytics. You
should have already installed the ultralytics package back in Lab
7, but if necessary, you can install it now by activating your
virtual environment and then doing "pip install untralytics".
- YOLO26 comes in five sizes, denoted by a one-letter code:
(n)ano, (s)mall, (m)edium, (l)arge, and e(x)tra large. It also
comes in several variants for detection, segmentation, etc. We're
going to use the small segmentation model, named yolo26s-segment.
- Download train_segmenter.py
into your lab8 folder.
- Run the program to train your segmenter.
- cd to the lab8/runs/segment folder and you will see folders
named "train", "train2", etc., depending on how many times you've
run the training script. cd to the latest one.
- Examine the images in this folder to see the results of
training.
- cd back to your lab8/data folder.
- Download test_segmenter.py
into your lab8 folder.
- If you have done more than one training run, edit
test_segmenter.py to set the WEIGHTS_VERSION variable to the
correct folder.
- Run the program and type a space in the cv2 window to move
through the test images.
- If you're not satisfied with the results, consider either
training for more epochs or expanding your dataset.
|