Use custom trained ...
 
Notifications
Clear all

Question Use custom trained model with PeekingDuck

10 Posts
4 Users
0 Likes
547 Views
Posts: 7
Member
Topic starter
(@markv)
Active Member
Joined: 6 months ago

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

9 Replies
Gao Hongnan
Posts: 28
Moderator
(@gao-hongnan)
Eminent Member
Joined: 8 months ago

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!

Reply
Gao Hongnan
Posts: 28
Moderator
(@gao-hongnan)
Eminent Member
Joined: 8 months ago

Hi, may I check if you are using RoboFlow's tutorial here?

Reply
Posts: 7
Member
Topic starter
(@markv)
Active Member
Joined: 6 months ago

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.

Reply
Gao Hongnan
Posts: 28
Moderator
(@gao-hongnan)
Eminent Member
Joined: 8 months ago

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.

Reply
3 Replies
dotw
 dotw
AISG Staff
(@dotw)
Joined: 9 months ago

New Member
Posts: 1

@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. 

Reply
Member
(@jonasss)
Joined: 4 months ago

Active Member
Posts: 4

@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?

Reply
Gao Hongnan
Moderator
(@gao-hongnan)
Joined: 8 months ago

Eminent Member
Posts: 28

Hi @jonasss, please refer to the link in the tutorial for an illustrated example of how to use a custom model within PeekingDuck.

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.

 

Reply
Page 1 / 2
Share: