Open frmunozForcast opened 2 years ago
Hey @frmunozForcast , I'd suggest you stick with YoloV4-tiny for depthai devices if you want the model to work in real time.
However, if you still want to convert the model, you'll need the following changes:
up_route_23=net
in L61. That is right before
net = _yolo_res_Block(net,128,8,data_format)
up_route_54
with up_route_23
in L100 and L102_upsample
in L100 reads the shape from up_route_23
, there's no need in setting another strides to 4 like in CFG file.strides=4
in L165Best, Matija
Hey @frmunozForcast , I'd suggest you stick with YoloV4-tiny for depthai devices if you want the model to work in real time.
Yes, we will probably change to Yolov4-tiny, however, we would compare performance between using 2 yolo layers to 3 yolo layers for our specific scenario, in which case i'll also need to change other parts of the code as well.
However, if you still want to convert the model, you'll need the following changes:
Thanks for the tips!, ill try this
I think adding 3 layers shouldn't be problematic as well. If you edit the code and make it controllable by a flag, feel free to make a pull request :)
Yes it wasn't that difficult, I managed to add both changes on a fork adding an optional flag that points to a config file where the specifics for custom model are defined. However, I have jet to confirm that the models are correctly converted. Once I've checked that, ill send the pull request.
Thank you for your help!
Hi,
I'm using a darknet yolov4-custom model for detecting small objects modified according to this guide darknet-small-objects, which we plan to run on a depthAI device (we will later change to yolov4-tiny, also customized). However, I'm having troubles to adapt your code so I can convert to .pb format (Im following your colab guide to transform darknet to blob)
So far I understand a bit how your code works to transform darknet yolo to tensorflow .pb and I've managed to modify the code for custom classes, anchors and masks. However, one of the modifications made on my custom yolo was set
layers = 23
instead oflayers = 54
in the route before the firs yolo layer (L895 in custom .cfg). As I understand, this means that I have to replaceup_route_54
in L100 and L102 withup_route_23
, but I do not know how to captureup_route_23
, any guide or idea?I've also modified the
stride = 2
tostride = 4
in the line just before the modified route. Do I have to change something else related to this stride?.Thanks!