Object detection is a computer technology related to computer vision and image processing that deals with detecting instances of the semantic objects of a certain class (such as humans, buildings, or cars) in digital images and videos. MobilenetSSD is an object detection model that computes the bounding box and category of an object from an input image. This Single Shot Detector (SSD) object detection model uses Mobilenet as backbone and can achieve fast object detection optimized for mobile devices.
- The SSD architecture is a single convolution network that learns to predict bounding box locations and classify these locations in one pass. Hence, SSD can be trained end-to-end. By using SSD, we only need to take one single shot to detect multiple objects within the image, while regional proposal network (RPN) based approaches such as R-CNN series that need two shots, one for generating region proposals, one for detecting the object of each proposal. Thus, SSD is much faster compared with two-shot RPN-based approaches.
- Mobilenet SSD takes a (3,300,300) image as input and outputs (1,3000,4) boxes and (1,3000,21) scores. Boxes contains offset values (cx,cy,w,h) from the default box.
- Create virtual environment
python -m venv VIRTUAL_ENV_NAME
and activate it.\VIRTUAL_ENV_NAME\Scripts\activate
. - Install necessary library for this project from the file
requirements.txt
or manually install bypip
.To create project library requirements, use below command,pip install -r requirements.txt
pip freeze > requirements.txt
-
# Below are the clsses that model can detect live CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]
- Run app.py python file
python run app.py
ObjectionDetection_KunalK.mp4
. # Root directory
βββ ssd # Model directory
β βββ MobileNetSSD_deploy.caffemodel # MobileNetSSD Model
β βββ MobileNetSSD_deploy.prototxt.txt # prototype data file
βββ static # Website data
β βββ css # Css effect files
β βββ downloads # Resultant files
β βββ fonts # Fonts files
β βββ img # Static images
β βββ js # Javascript effect files
β βββ uploads # Upload files for object dettection
βββ templates # Template directory
β βββ index.html # Index page
β βββ error_404.html # Error page
βββ Aptfile # Apt-based dependencies (Heroku: compile + runtime)
βββ Procfile # App init (init: app + server: gunicorn)
βββ app.py # Application main file
βββ classes.py # Object detection handler with model and classes
βββ requirements.txt # Project requirements library with versions
βββ README.md # Project README file
βββ LICENSE # Project License file
Live Aplication is running on heroku cloud platform, you can access from below.
You say freak, I say unique. Don't wait for an opportunity, create it.
Letβs connect, share the ideas and feel free to ping me...