Question Use custom trained model with PeekingDuck
Hello to everybody
I wanted to ask how can I use a custom trained model through PeekingDuck. I've managed to train a custom model based on the yolo v4 tiny with Roboflow and got the new weights. How should I replace the default ones of the tiny yolo v4 with my new ones?
Thanks in advance
Hi there, thanks for the question! Noted that you are using Roboflow to train the custom model.
Let me have a short discussion with my team and get back to you! Cheers!
Yep this is it. I was actually trying to add a couple of classes to my yolo v4 tiny model so i've trained it with a few custom images in order to have better detection regarding these classes. But i'm not sure how to proceed with importing the trained model and use it through peeking duck instead of the default one.
Hi, in that case, you may have to create a custom node to inference your custom-trained model.
Here's a tutorial to get you started, however, if you have troubles, feel free to reach to me via messages, and we can connect further.
Thank you very much! I will try it out and if I fail I will get in touch. 🙂
@markv Just to explain a bit on why a custom node is required: PeekingDuck default model weights cannot be replaced, as there is a built-in check for file integrity, which will fail if the weights do not match. Hence, you need to save your custom weights in a sub-directory and write a custom node to load those weights, init the model and use that to do your custom inference.
@dotw Hi, my friends and I are actually attempting a project which is similar to the original poster's post. We would like to ask exactly how to write the custom nodes to load the custom weights we have saved after we have trained the model using Yolo v4 using the Darknet Framework, following @gao-hongnan's post roboflow tutorial link earlier in this discussion?
More concretely, for the custom model node you have to need to do two things:
1. Load the trained model weights into memory;
2. Perform inference by calling the model on the inputs.