Link to home
Start Free TrialLog in
Avatar of Anwar Saiah
Anwar Saiah

asked on

How do I use Detecto based on Pytorch the right way, to get a small size detction model that works fast?

I have trained a model to predict (detect) an object in images, a geometric shape.
I used about 90 images for training, used labelImg, it's a tool to draw rectangles around objects.
From those images and their xml files, made by labelImg I built a database, for Detecto to train.
Once that has been accomplished I saved the resulting model(.pth file), and used it to detect objects in new images.
Followed this tutorial:
Custom trained object detection in 5 lines of code.

https://towardsdatascience.com/build-a-custom-trained-object-detection-model-with-5-lines-of-code-713ba7f6c0fb

The model(weights.pth) I use for detection weighs 150MB, I had the impression that once a neural networks has been trained to detect an object, it gives back a matrix with some weights, which can be used for detection.
But that would only be a few MegaBytes max!
Why is detecto using the whole 150MB database for detection(images I used are 90 in number and close to 150MB in size)? and why does it take about 2 seconds to detect the object in the image? My first impression was that Detecto would let me download a single Matrix with weights and formula to which I feed an image and in a few milliseconds would give me a detection.Please explain in general what is going on here. Thank you.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.