umyelab / LabGym

Quantify user-defined behaviors.
GNU General Public License v3.0
58 stars 5 forks source link

How to transfer Detector/Categorizer from laptop to PC #151

Closed dylankimnguyen closed 2 weeks ago

dylankimnguyen commented 2 months ago

Hi, if I have a detector/categorizer trained on my laptop, and I want to work on my pc, how can I transfer it?

dylankimnguyen commented 2 months ago

I also currently am on a windows surface pro with these specs:

image

I have a university PC which I can get access to, but if I were to train at home using the non interactive mode, would this be fine? Or will it take too long? I will use the PC in a few days, but am wondering for now.

yujiahu415 commented 2 months ago

You can find the trained Detectors in the LabGym/detectors folder and find trained Categorizers in the LabGym/models folder. To find where LabGym installed in your computer, type pip show LabGym.

If you want to train a Categorizer on your laptop, try setting complexity level <=3 and input shape <=32, then the training won’t take too long. If you want to train a Detector, GPU is recommended.

dylankimnguyen commented 2 months ago

Hi, another question: How can I deal with this error? It happened after starting to train the categorizer, I kept I think all the default settings.

github10
yujiahu415 commented 2 months ago

Hi, This is not an error. Your Categorizer has training had successfully completed.

dylankimnguyen commented 2 months ago

Okay thanks, I will test it

dylankimnguyen commented 2 months ago

Hi, so everything is working great, however I have only used one orangutan video, so if I want to detect and analyse orangutan behavior from other videos within the same enclosure but in different locations, what is the best method to do this?

Would I add multiple new videos for the generate image examples, then annotate more in Roboflow, then retrain the detector? And do the same for the behavior?, add multiple new videos for generate behavior examples, then sort these (and add the old sorted behavior with the new) then retrain a categorizer?

yujiahu415 commented 2 months ago

Hi, You can just use the trained Detector and Categorizer to test if they can generalize to other videos. If not, add more training examples for both to cover the unseen scenarios.

dylankimnguyen commented 2 months ago

Hi, for example from here:

image

If i want to add more training images to the previous detector, when it asks me "enter a name for the Detector to train", do I add the name of the previous detector which i already trained? Or do I need to retrain the detector?

yujiahu415 commented 2 months ago

You cannot retrain a previous Detector. You need to combine old examples and new examples and train a new Detector.

dylankimnguyen commented 2 months ago

I see, I have some other questions:

Would you recommend me using multiple videos showing different scenarios but annotating less frames for each, or using less videos but annotating more frames?

Also, when I am selecting a video to be analysed in the analysis section, should the video analysed be a preprocessed video? Or a new video. (I tried to analyse a new preprocessed video and I got NA as what was detected.)

yujiahu415 commented 2 months ago

In general I would recommend you to use more videos of different scenarios and annotate a few frames for each. When you generate dataset in Roboflow, you can use augmentation to increase the amount of training images.

As for preprocessing, if you choose to do preprocessing for the videos used for training, you can use the same way of preprocessing for the videos to analyze. And if you just use the videos to analyze to generate training examples, the analysis accuracy can be maximized.

vincent-legoll commented 1 month ago

related issue: https://github.com/umyelab/LabGym/issues/145