make-sense icon indicating copy to clipboard operation
make-sense copied to clipboard

Import custom model

Open balaji-skoruz opened this issue 3 years ago β€’ 8 comments

I need to import my custom model to annotate fast. and I have custom objects. I am using YOLO for object detection.

balaji-skoruz avatar Apr 01 '21 16:04 balaji-skoruz

Hi πŸ‘‹ , @balaji-skoruz! Are you using https://github.com/ultralytics/yolov5?

SkalskiP avatar Aug 27 '21 12:08 SkalskiP

Yes.

balaji-skoruz avatar Aug 27 '21 12:08 balaji-skoruz

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.

SkalskiP avatar Aug 27 '21 13:08 SkalskiP

Ok. Thanks,

balaji-skoruz avatar Aug 27 '21 13:08 balaji-skoruz

@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

SkalskiP avatar Aug 27 '21 13:08 SkalskiP

@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 avatar Dec 20 '21 18:12 SkalskiP

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

voicccc avatar Aug 02 '22 01:08 voicccc

Hi, @voicccc πŸ‘‹! We are currently in the middle of integration with yolov5, so that branch may currently not work for you.

SkalskiP avatar Aug 02 '22 08:08 SkalskiP

@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

SkalskiP avatar Oct 04 '22 16:10 SkalskiP

d

5starkarma avatar Oct 18 '22 02:10 5starkarma

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? :)

SkalskiP avatar Oct 18 '22 05:10 SkalskiP

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.

5starkarma avatar Oct 18 '22 15:10 5starkarma

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 🧐

SkalskiP avatar Oct 19 '22 08:10 SkalskiP

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 avatar Oct 19 '22 13:10 5starkarma

@5starkarma how about adding a page describing what you need to do in make-sense documentation, and including the link to the docks?

SkalskiP avatar Oct 19 '22 17:10 SkalskiP

@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 avatar Oct 19 '22 18:10 5starkarma

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

SkalskiP avatar Oct 19 '22 19:10 SkalskiP