make-sense
make-sense copied to clipboard
Import custom model
I need to import my custom model to annotate fast. and I have custom objects. I am using YOLO for object detection.
Hi π , @balaji-skoruz! Are you using https://github.com/ultralytics/yolov5?
Yes.
Ok. so far we have not anticipated the import of custom models into make-sense. But given the recently added model export functionality to yolov5 for tf.js, it seems to me that we could work out a way to import such models. I do not yet have a solution ready, but I will investigate the matter.
Ok. Thanks,
@glenn-jocher take a look interesting idea of using yolov5 and make-sense in a closed loop:
label images in make-sense -> use labels to train yolov5 model -> convert the model to tf.js -> use custom model to label more images -> use labels to train yolov5 model
@IuliuNovac laid a solid foundation for the implementation of this task, with his last PR. I will work on polishing his idea to add full support for YOLOv5 and uploading your own models trained using this repository.
@SkalskiP hi, Can the branch that can use the yolov5-tf inference model run correctly? Tried the branch '/feature/156_import_custom_model_yolov5', but an error was reported during npm install,
Hi, @voicccc π! We are currently in the middle of integration with yolov5, so that branch may currently not work for you.
@voicccc and @balaji-skoruz that functionality has been added within https://github.com/SkalskiP/make-sense/pull/276. You can now load pre-trained and custom models to makesense.ai.
https://user-images.githubusercontent.com/26109316/193878510-89bd0e10-1713-4601-872a-dc97a5f22f71.mov
d
Hi, @5starkarma I saw in my email that you originally posted I question about .txt
. file. But now I see it is no longer here. Does that mean that you managed to solve that problem on your own? :)
Hi! Sorry about that! It wouldn't let me delete the comment!
No, I actually deleted the comment and responded on Reddit to a post you had made because I was unsure how active you were here. It says:
I tried adding a custom yolov5 model with the bin files and the json file but it is asking for a .txt labels file for classification labels. What format do I need to create this in? Would be nice if the site could tell me that as the labels arenβt automatically exported by yolov5 :)
I did however find that adding a class per line in a .txt
file seems to work but I am unsure if it is the correct way.
Hi, @5starkarma π! I'm actually much more active on GitHub than on Reddit.
I'm still looking for a better way to define the class names list. Unfortunately YOLOv5 tensorflow.js export does not allow you to include a class list inside the model file. That's why we need to pass them in a separate file.
Here is the GH issue where I provide instructions on how to do it: https://github.com/SkalskiP/make-sense/issues/222
If you have ideas on how to do it better. I'm really happy to listen π§
The way you do it actually works but, to improve your UX a small margin, it would be nice to see instructions on what format the classification list labels.txt
has to be in. I figured it out but just a suggestion :)
@5starkarma how about adding a page describing what you need to do in make-sense documentation, and including the link to the docks?
@SkalskiP that would be a great idea. It seems #282 has a similar issue. Though mine is focused on uploading a custom model. Do you need me to update the docs? If so, would you mind linking me?
@5starkarma I already started to work on the docs update. It is something that I wanted to do for a long time, and right I'm motivated to do that. I will share the updated docs soon. I'm happy for you to review them if you will have time.
You are right. Your issue is not the only one related to the class names file. That's why I said that I'm unhappy with that solution. I frequently get issues and requests from people that feel it is hard to understand how it works.