Realtime Object Detection On Your Phone

Moshe Sipper, Ph.D.
2 min readJun 20, 2023
https://play.google.com/store/apps/details?id=com.moshesipper.FindersDeepers

Detecting objects in an image is a major task assigned to deep-learning models these days. And the main family of algorithms doing object detection right now is YOLO: You Only Look Once.

There are many excellent stories about YOLO here on Medium, and I do not wish to attempt a new one…

One of the main issues with Deep Learning models is their use of vast computational resources. This is certainly true of the training process, but the issue often leaks into deployment as well: running a trained deep model can require quite a bit of hardware.

There’s a lot of ongoing research about making models smaller. It would be great, for example, if we could run deep models on our phones.

What about YOLO? Well, most of the trained YOLO models are available on GitHub:

Lo and behold, there are some small models, such as Tiny-YOLOv7!

Are they small enough to run on a mobile device?

Well, I turned to Unity, a game engine that has been used to create over half of existing mobile games (possibly as high as 60% or 70% of mobile games).

Unity has an Asset Store, with numerous shared packages, which make a game designer’s life easier. Further, you can compile your game into a number of platforms, including mobile devices.

Well, using Unity, along with various assets, I was indeed able to build an app, coaxing my phone into running object detection in real-time.

To make things more fun, I designed two simple games:

  1. More Merrier: Try to find as many kinds of objects as you can. The maximum is 80, which is the size of the MS COCO (Microsoft Common Objects in Context) dataset YOLO was trained on.
  2. Treasure Hunt: Try to find the treasure piece…

Here’s the link to my app.

Enjoy!

--

--

Moshe Sipper, Ph.D.

🌊Swashbuckling Buccaneer of Oceanus Verborum 🚀6x Boosted Writer