# TensorFlow in your browser: Object Detection with Bounding Boxes

## Welcome

Danger: This guide is deprecated as it uses TensorFlow 1 which has itself been deprecated

You've heard about Machine Learning and AI - and you want to see what all the fuss is about. But you _don't_ want to spend all your time installing **bazel** and **Jupyter**? Or maybe you're running an old computer or your only computer is a phone! What now, give up? _Never!_ Thanks to Google Colab, you can run TensorFlow in a browser window, and all the computation is handled on Google's cloud service for free. It's a great way to dabble, without all the setup!

We've hacked together a Colab notebook that can see things using your computer, laptop, or phone camera! It takes live pictures from your camera and feeds them through [the _Mobilenet v2 + SSDLite_ model](https://ai.googleblog.com/2018/04/mobilenetv2-next-generation-of-on.html) to find and box the objects it sees. This way you can see what Mobilenet v2 + SSDLite can do, instantly!

![](https://cdn-learn.adafruit.com/assets/assets/000/082/150/medium800thumb/camera_ex2-fade.jpg?1570471437)

Info: 

# What is Object Detection?

Object Detection models find known objects in pictures. More advanced models also know how to *bound* the things they see--that is, they can tell you exactly where in the image it thinks they are. 

Take a look below:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/828/medium800/camera_Untitled.png?1569962019)

The algorithm produces three outputs here:
* **The identified object**, given both by name (water bottle) and an id number
* **Confidence Level**, a measure of the algorithm's certainty
* **Bounding box**, a box drawn around the image region that contains the object

Early object detection algorithms used hand-written heuristics to identify objects. For example: a tennis ball is usually round and green. While these had some successes, they were difficult to create and were prone to some hilarous false-positives.

# Mobilenet v2

In recent years, a technology called *neural networks* has made it possible to let computers develop the heuristics on their own, by showing them a large number of examples. *Mobilenet v2* is one of the well-known Object Detection models beacuse it's optimized to run on devices like your cell phone or a [raspberry pi](https://blog.adafruit.com/2019/09/09/machine-learning-monday-mobilenet-v4-ssd-lite-on-raspberry-pi-4-adafruit-raspberry_pi-tensorflow-machinelearning-tinyml-raspberrypi/). When attached to another model known as *SSDLite*, a bounding box can be produced.

The authors of Mobilenet v2 + SSDLite claim it runs in 200ms on a Pixel 1. You won't be able to see speeds like this in your browser because this demo sends images securely over the Internet to Google's datacenter for processing. But, think of this as a helpful reference if you want to use this in your own project.

Mobilenet v2 + SSDLite can recognize [90 different objects](https://github.com/tensorflow/models/blob/f87a58cd96d45de73c9a8330a06b2ab56749a7fa/research/object_detection/data/mscoco_label_map.pbtxt).

These objects are taken from the [COCO dataset](http://cocodataset.org), a popular set of images used to develop object detection algorithms.

- [Next Page](https://learn.adafruit.com/tensorflow-in-your-browser-object-detection-with-bounding-boxes/opening-the-notebook-2.md)

## Related Guides

- [TTL Serial Camera](https://learn.adafruit.com/ttl-serial-camera.md)
- [Capturing Camera Images with CircuitPython](https://learn.adafruit.com/capturing-camera-images-with-circuitpython.md)
- [Basic TensorFlow Object Recognition on any Computer or iOS device with Google Colab](https://learn.adafruit.com/basic-tensorflow-object-recognition-in-the-cloud-google-colab.md)
- [Cloud Cam: Internet-Connected Security Camera](https://learn.adafruit.com/cloud-cam-connected-raspberry-pi-security-camera.md)
- [NFC Raspberry Pi Media Player](https://learn.adafruit.com/nfc-raspberry-pi-media-player.md)
- [Memento Photo Capture with itsaSNAP](https://learn.adafruit.com/memento-photo-capture-with-itsasnap.md)
- [Adafruit BrainCraft HAT - Easy Machine Learning for Raspberry Pi](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi.md)
- [PiGlass](https://learn.adafruit.com/piglass-wearable-raspberry-pi-computer.md)
- [CircuitPython Webcam with OV2640](https://learn.adafruit.com/circuitpython-webcam-with-ov2640.md)
- [MEMENTO Camera Quick Start Guide](https://learn.adafruit.com/memento-camera-quick-start-guide.md)
- [CircuitPython Libraries on any Computer with MCP2221](https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-mcp2221.md)
- [Narrative Clip Teardown](https://learn.adafruit.com/narrative-clip-teardown.md)
- [LoRa and LoRaWAN Radio for Raspberry Pi](https://learn.adafruit.com/lora-and-lorawan-radio-for-raspberry-pi.md)
- [Rx Snapchat Spectacles for DIY and STEM](https://learn.adafruit.com/prescription-snapchat-spectacles.md)
- [Adafruit Pinguin for EAGLE CAD](https://learn.adafruit.com/adafruit-pinguin-for-eagle-cad.md)
