# Accelerator comparison
###### tags: `aic2021`
[TOC]
## Proposed AI application: Mask detection
In this project, we proposed an AI application that is capable of detecting whether a person is wearing a mask on a single webcam. The input of this system is video stream from a webcam. The ouptut of this system is a bouding box that goes around human faces. The box will turn green if the AI model detects that a person wears a mask. If not the box turns red.
## AI model
- SSD for object detection
- MobilenetV2 for mask detection
## Acceleration on Kneron® KL520 AI dongle
### Testing platform
- Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
- Ubuntu 20.04.2 LTS
### Performance (Single face)
- vs.read() time: ~0.0018 s
- OpenCV resize: ~0.001 s
- SSD inference time (CPU): ~0.012 s
- CNN inference time (USB): ~0.026 s
## Acceleration on Intel® Movidius™ Myriad™ X
### Testing platform
- Intel(R) Atom(TM) Processor E3940 @ 1.60GHz
- Ubuntu 18.04.5 LTS
### Performance (Single face)
- vs.read() time: ~0 s
- OpenCV resize: ~0.01 s
- SSD inference time (CPU): ~0.1 s
- CNN inference time (VPU): ~0.027 s
## Mask detector with OpenCV, Keras/TensorFlow
### Two-phase mask detector

1. __Training__: Loading our face mask detection dataset(`with mask` or `without mask` images), training a model using keras/TensorFlow on these dataset and output a Mask Detection model.
2. __Deployment__: Before classify the mask, we need to find one or more faces in the image. Therefore, we need another SSD model to do object detection to mark the faces and find the bounding box of each face.