Thanks, Erik, I have used Roboflow and used up my training credits. Last night I got a Tflite model to train with my data on the laptop so that I can load it into the Raspi. So making progress! But "Easy" is not a word I would use to describe the process.
Easy?? Object Detector Training
I feel your pain Russ.
I've gone through plenty of enormous Juypter notebooks- only for some cryptic & unsolvable error right at the end
I'd recommend YOLOv5 for a relatively easy object detection https://github.com/ultralytics/yolov5
It is well documented and works well- I suggest using the Docker option
Ultralytics HUB https://ultralytics.com/hub is by the same people- although not the same as Roboflow, it makes training an OD model easy, and will export to a number of formats, including TFLite
You can train your model with a very simple COLAB notebook, or with a local agent
Andrew
Tensorflow Lite is not too bad to train a model, the script for that is only a half page. Too bad it's hard to convert the Tflite model into the Myriad blob! I'm using sections of 640 x 300 for detection, and three of those makes the full width of RGB camera, 1920. But this technique won't work in the Oak-D camera, to take the image apart in the Raspberry Pi and send it back to the camera for examination! Too slow!
Hi Russ76 ,
To convert TFLite to Myriad model you could check out this tool: https://github.com/PINTO0309/tflite2tensorflow
It will automatically convert the model not only to TF, but also to OpenVINO's IR and Myriad blob.
Thanks, Erik
Is there a reason to use the full width and split image into patches @Russ76 ? Are you dealing with extremely small objects? Otherwise you could just resize the images to something smaller (512 x 288, which preserves 16:9 aspect ratio) and do inference on this input shape, which should work on OAK.
As for training, if YoloV5 training notebook is too complex, I think it might be best to use something like https://ultralytics.com/hub as @barney2074 pointed out. You can then download the weights and use tools.luxonis.com to obtain a blob. In tutorial we link to: https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data#train-on-custom-data, which best explains how to prepare your dataset (see manually prepare your dataset) and also how it should be organized. This folder should be put in the corresponding path in Colab.
Ultralytics HUB is currently in beta and is free
Unlike Roboflow- you don't train on their server-, but use either local hardware or in Colab
I've got a spare PI somewhere- I might try the TFlite export as a comparison
Andrew
Matija Yes, I need the full width since the camera is mounted 18 inches above the lawn, and from there can capture the 20 inches of width of the robot. The AI is searching for weeds in the lawn. The height of desired image is narrow because the spray wand timing, to hit the weed, will need to be similar for each detection. The wand swings from side to side only, no fore and aft movement. Thanks for asking
Hi Russ76 ,
I agree, it's hard to setup and still quite tricky to get it right. Unfortunately these AI tools are all like this - that's why we created blobconverter for openvino conversion and blob compile (as those are tasks are complex as well, see here). We might add the tflite2tensorflow
tool to our blobconverter in the future, especially if we will "officially support" a particular model (like we currently support yolov5).
Thanks, Erik
Did you change the Blobconverter? I used it on a Yolo5 model, but I don't see that option now!?
Hi Russ76 ,
What do you mena yolov5 isn't supported anymore? We have yolov5 training/deplyoment notebook here and https://tools.luxonis.com support yolov5 as well (which uses blobconverter). Thoughts?
Thanks, Erik
That's right. I was looking for tools.luxonis.com and the not the blob converter page. I don't know that there are enough references or links to the former. Is that in your documentation? Trying to use onnx or openvino for conversion is difficult. Thanks
The notebook page has so many steps that I found I didn't need! tools.luxonis.com will take the weights file (best.pt) from Yolov5 and convert that into the needed blob. Why work with Onnx and Openvino installations when it's not necessary? Or am I missing something here?