agentmorris / MegaDetector

MegaDetector is an AI model that helps conservation folks spend less time doing boring things with camera trap images.
MIT License
86 stars 20 forks source link

Question on Running CPU vs GPU #116

Closed tkmontana closed 9 months ago

tkmontana commented 9 months ago

Besides speed, are there performance differences when running megadetector on a CPU vs a GPU (or a lower quality GPU)? Particularly curious about differences in classifier confidence. Sorry if this is a dumb question :) TIA!!

agentmorris commented 9 months ago

Thanks for reaching out!

Short version...

No, there are no differences, MegaDetector is MegaDetector. Or, more specifically, for example, MDv5a is MDv5a. If you run MDv5a on a CPU vs. the world's fastest GPU using the recommended instructions, you will get exactly the same results out to a zillion decimal places.

Long and unnecessarily nuanced version...

Really, this is way out into the weeds, so I wouldn't worry about most of this. When in doubt, go with the short version above. :) But I didn't want to promise that everyone always gets exactly the same results without qualifying things a bit.

There are several ways you can "run MDv5a" but end up with very slightly different results than someone else who also "runs MDv5a". I stress these are very small differences, but they are just enough to be annoying if you literally want to compare the equality of confidence values and box coordinates:

Hope that helps!

Always feel free to reach out here, or to email cameratraps@lila.science with questions. Happy MegaDetect'ing!

tkmontana commented 9 months ago

This is great - the in depth explanation is really helpful. Thank you!!