Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Trouble using my own YOLO weights and classes

0 votes

I have trained Darknet YOLO using my own set of classes. I've copied them over to the camera. I've set the parameters to use these files with the following commands:

setpar datacfg cfg/pdq_obj.data

setpar cfgfile cfg/pdq.cfg

setpar weightfile weights/pdq_3100.weights

setpar serout All

setpar serstyle Detail

I get a response of "OK" for each line. However, it's still using the standard classes. Any hints on additional debugging I can do? It's possible I have a path wrong, but I don't get any error messages so it's hard to tell. Do I have to reset Yolo somehow?

<edit> Looking at the YOLO.C file, there are calls to output these values via LINFO. However, I can't figure out how to get the LINFO to go to my serial port. It also appears that I need to have these values set during initialization. I don't know how to pass these values before setting up the camera for YOLO. If I send them before I've selected YOLO it doesn't recognize them. If I send them after, it doesn't seem to use them. I've also tried using setmapping to select YOLO without streaming, setting the values and then starting streaming. Getpar shows that it has my values, but for some reason it's not using them.

asked May 25 in User questions by PeterQuinn (820 points)

1 Answer

+1 vote

We had some logic in there to reload YOLO after a parameter change, but maybe it is not working well when you do it interatively, likely a bug that we need to fix. The recommended way is to put those settings in a file JEVOIS:/modules/JeVois/DarknetYOLO/params.cfg as follows:

datacfg=cfg/pdq_obj.data

cfgfile=cfg/pdq.cfg

weightfile=weights/pdq_3100.weights

serout=All

serstyle=Detail

And your network should now be loaded next time you select YOLO. To see the LINFO messages, do a "setpar serlog USB" (or Hard).

answered May 26 by JeVois (26,700 points)
Still having problems with custom weights
FYI. Looks like the params.cfg file needs unix style line terminations (/n) not what windows uses (cr/lf)
<<Update>> Maybe not. After I fixed the file, I can no longer reproduce the problem, even with new params.cfg. I'm stumped why it works now and didn't work before.
...