Posted in Home

Using AI for object classification.

In this post I will show you the easiest way to combine AI, convolution neural network(CNN) and docker container to classified object in real time. So all thing you need to know is basic knowledge about docker and neural network. If you are very new to programming, don’t worry, just follow the step below, and you will have a program classified object in real time.

in the video above I’m driving a car go around with a camera on top, to tracking other car and person inside it. I use CUDA Yolo + Nvidia GPU. You can also do the same, all you need to do is download my Docker file and run it.

For who need to understand the theories behind, I will summaries like this. The docker file will create a Ubuntu Linux environment and install Nvidia GPU+OpenCV+darknet in to it. Darknet is a wonderful neural network, it was train by around 10 millions picture and can real-time recognize about 70 categories (car, dog, cat, ship, plane….). If you want to learn more about darknet, you can read my article :

OK! now let’s go the AI world:

Darknet Nvidia-Docker Ubuntu 16.04


  1. Make sure you have the NVidia driver for your machine

Find out your the Graphics Card model

lspci | grep VGA

How to install NVidia Drivers on Linux

  1. Install Docker and NVidia Docker

Steps to run

  1. Clone this repo:
git clone
  1. Build the machine (this step might take a while, go make some coffee)
docker build -t darknet .
  1. On make sure you have the correct address of your webcam, in file line 8, if you use laptop onboard webcam, then choose: device=/dev/bus/usb/003/004:/dev/video0, if use external webcam, then: device=/dev/bus/usb/003/004:/dev/video0

Find your webcam bus

lsusb -t

Change the following line with the correct webcam bus

  1. Map a local folder to the Docker Container



on change the following line

-v /home/projects:/dev/projects \
  1. Run the machine with Webcam


Make sure you have the weights for what you want to run

More information at



My name is Truong Thanh, graduated Master of Information Technology and Artificial Intelligent in Frankfurt University,Germany. I create this Blog to share my experience about life, study, travel...with friend who have the same hobbies.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s