#Event – Resources for the sessions about #DeepLearning and #CustomVision at the @ChicagoCodeCamp

Hi!

Another post-event post, this time with a big thanks to the team behind one of the most amazing event I’ve been this year: Chicago CodeCamp.

I had the chance to meet a lot of amazing people, to learn a lot during the sessions and also to visit the great city of Chicago.

As usual, now it’s time to share slides, code and more.

Deep Learning for Everyone? Challenge Accepted!

Let’s start with the Deep Learning resources


Demos Source Code: https://github.com/elbruno/events/tree/master/2019%2005%2011%20Chicago%20CodeCamp%20Deep%20Learning

Session: How a PoC at home can scale to Enterprise Level using Custom Vision APIs

And also the [How a PoC at home can scale to Enterprise Level using Custom Vision APIs] resources

Demos Source Code: https://github.com/elbruno/events/tree/master/2019%2005%2011%20Chicago%20CodeCamp%20CustomVision

And finally, some Machine Learning.Net, Deep Learning and Custom Vision resources:

My posts on Custom Vision and ONNX

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi
  12. Average response times using a CustomVision.ai docker container in a RaspberryPi and a PC

Windows 10 and YOLOV2 for Object Detection Series

See you next one in Chicago for some Deep Learning fun!

Happy coding!

Greetings @ Toronto

El Bruno

Advertisements

#AI – Exporting #CustomVision projects to #docker for #RaspberryPi, the extra 2 steps

Hi !

I wrote several posts on how to create a image analysis solution using CustomVision.ai and how to export and use the project in a Raspberry Pi with Docker.

In my posts, I created a custom docker file for RPI using as a base the Linux one, from CustomVision.ai.

There is a new feature in Custom Vision, which allows us to directly export the docker image for Raspberry Pi.

This is amazing, and because I’m going to use it on Chicago CodeCamp, I decided to test it. And, of course, I got a couple of ugly errors when I try to build my image in the device.

Once I edit and read the docker file content, I realized that I need to disable the CROSS-BUILD option

And that’s it, now I’m waiting for the image to finish and I’ll be ready to test it!

Happy coding!

Greetings @ Toronto

El Bruno

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi
  12. Average response times using a CustomVision.ai docker container in a RaspberryPi and a PC

Windows 10 and YOLOV2 for Object Detection Series

#AI – Mis posts sobre CustomVision.ai, exportando y utilizando ONNX, Docker, en PC, RaspberryPi, MacOS y más !

Buenas !

Ahora que tengo una pausa entre eventos en Canada y USA, y ya he escrito varios posts al respecto, es el tiempo ideal para compilar y compartir los posts que he escrito sobre CustomVision.ai. Sobre como crear un proyecto de reconocimiento de objectos, como utilizar el mismo en modo web, invocando un HTTP Endpoint desde una app de consola. Y también desde aplicaciones en Windows 10 exportando el proyecto a formato ONNX y utilizando Windows ML. Finalmente, un par de post donde explico como utilizar CV.ai con docker en PC, Mac y Raspberry Pi.

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi
  12. Average response times using a CustomVision.ai docker container in a RaspberryPi and a PC

Windows 10 and YOLOV2 for Object Detection Series

Greetings @ Burlington

El Bruno

#AI – My posts on CustomVision.ai, running on ONNX, Docker, on PC, RaspberryPi, MacOS and more !

Hi !

After the events in Canada and USA, and several posts, I think it’s time to make a recap of the posts I’ve wrote about CustomVision.ai and how I created a custom object recognition project. And later used this as a web HTTP Endpoint in a Console application. And also in Windows 10 with ONNX using Windows ML; and finally running the Object Recognition project inside a Container in Docker on PC, Mac and Raspberry Pi.

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi
  12. Average response times using a CustomVision.ai docker container in a RaspberryPi and a PC

Windows 10 and YOLOV2 for Object Detection Series

Greetings @ Burlington

El Bruno

#Docker – Tiempos de respuesta promedio utilizando #CustomVision.ai en un contenedor con Docker en #RaspberryPi u en PC

Buenas !

Alguien me pregunto por la performance de un proyecto de customvision.ai ejecutándose en una Raspberry Pi, y se me ocurrió que la mejor forma de explicarlo es mostrar las diferencias de tiempos de respuesta del mismo contenedor en Docker en PC y en una Raspberry Pi.

La PC donde haré la prueba tiene la siguiente configuración

w10 specs

Nota: Se que esto es bastante subjetivo, que para realizar una prueba real debería apuntar otros datos como el tipo de disco (SSD), apps en ejecución y más. La idea es tener un punto de referencia no una comparación completa.

El proceso de ejemplo para analizar 20 imágenes tarda unos 10.45 segundos en PC.

cv marvel docker local times

El mismo proceso en una RaspberryPi se ejecuta en 70.46 segundos.

cv marvel docker raspberry pi times times

Los tiempos promedio son

  • PC, 0.52 segundos
  • Raspberry Pi, 3.52 segundos

Y la conclusión es fácil: tener un device que permite analizar imágenes en 3.5 segundos por menos de $30 es impresionante!

Happy coding!

Saludos @ Toronto

El Bruno

References

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi

Windows 10 and YOLOV2 for Object Detection Series

#Docker – Average response times using a CustomVision.ai docker container in a #RaspberryPi and a PC

Hi !

I was testing the performance of the same customvision.ai exported project, running in a docker container in standard PC and a Raspberry Pi. And, I’m really surprised and happy about the RPI times.

Let’s start with the times for a container running in a PC with the following specs

w10 specs

Note: I know this is very subjective, because there is more information needed for a deep study. Like SSDs, Windows 10 version, apps running and more. This is just for reference.

A sample process to analyze 20 images tooks 10.45 seconds.

cv marvel docker local times
The same process using a container in a Raspberry Pi took 70.46 seconds.

cv marvel docker raspberry pi times times

The average time are

  • PC, 0.52 seconds
  • Raspberry Pi, 3.52 seconds

Again, amazing times for a 30 dollars device!

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi

Windows 10 and YOLOV2 for Object Detection Series

#Docker – Sobre puertos, IPs y mas para acceder a un container alojado en #RaspberryPi

Buenas !

Mi proyecto de CustomVision.ai esta compilado y ejecutándose en Docker en Raspberry Pi 3. Ahora llega el momento de utilizar el mismo desde aplicaciones en otros dispositivos, y para este caso, todos en la misma red.

Cuando ejecute mi imagen, utilice parámetros para definir la IP y los mapeos de los puertos de la misma. El siguiente comando es muy útil para ver esta información en un container.

sudo docker port <CONTAINER ID>

01 docker port

Mi container esta registrado en la dirección IP 127.0.0.1 y utiliza el puerto 80. Esto es genial para procesos locales, sin embargo no permite que este container sea accedido desde otros devices.

Lo ideal es no registrar la direccion IP local 127.0.0.1 y solo definir el mapeo de puertos 80:80. En este caso ejecuto mi imagen con el siguiente comando

sudo docker run -p 80:80 -d <IMAGE ID>

02 docker port 80 and success run

El container utilizar el puerto 80, y Docker toma control de este puerto en la RaspberryPI. La dirección IP de la raspberry pi es [192.168.1.58], así que ya puedo realizar pruebas con Postman para analizar imágenes en la RPI.

03 docker image analysis from postman

Super cool. Un potente y barato server de análisis de imágenes basado en un proyecto de CustomVision por menos de $30 !

Happy coding!

Greetings @ Burlington

El Bruno

References

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies

Windows 10 and YOLOV2 for Object Detection Series

#Docker – About ports, IPs and more to access a container hosted in a #RaspberryPi

Hi !

So, my CustomVision.ai image is build and running in a container in my Raspberry Pi 3. It’s time to see if I can use it from other devices in the same network. When I run my image I defined IP and Port, but if you want to know these information, the following command is very useful

sudo docker port <CONTAINER ID>

01 docker port

So, my container is listening at 127.0.0.1 in port 80. That’s cool for local processing, however I want to access my container from other devices in the same network. In order to do this, I’ll run my image with the following command (I’m not defining the IP, just the port 80)

sudo docker run -p 80:80 -d <IMAGE ID>

02 docker port 80 and success run

The container is using the port 80, and docker is taking over this port in my device. My Raspberry PI device IP is [192.168.1.58], so I can go back and make some tests using Postman to analyze images in the device.

03 docker image analysis from postman

That’s cool. A small CustomVision image analyzer server for less than $30 !

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies

Windows 10 and YOLOV2 for Object Detection Series

#Docker – Container muere inmediatamente después de ser iniciado en #RaspberryPi. Obviamente, era un problema de dependencias de #TensorFlow

Buenas !

La creación de imágenes en Docker es un proceso divertido. Cuando cree la imagen de CustomVision.ai para ser ejecutada en Docker en Raspberry Pi, me encontré con unos errores interesantes, así que aprovechare este post para escribir sobre los mismos.

La compilación de cada imagen suele tardar alrededor de unos 15 minutos. Ver que la misma compila correctamente es un momento de alegría, que se veía arruinado cuando al momento intentar iniciarla, el container se destruía automáticamente. El comando con el que iniciaba el mismo es el siguiente

sudo docker run -p 127.0.0.1:8080:80 -d <IMAGE ID>

Estuve leyendo mucho y encontré varias opciones para intentar comprender que sucede. Al final opte por intentar analizar los eventos en tiempo real que Docker publica con el comando

sudo docker events&

01 docker events

En la consola podemos ver un buffer lleno de eventos de Docker. Después de varios intentos con mi imagen, me encontré con mensajes similares a los siguientes.

2019-02-12T07:34:46.195722938-05:00 container start cdcdcc410518db46e09967412bd583c33cff6f4e8eee0f10e8baeec860f9c9a2 (image=295, io.balena.architecture=armv7hf, io.balena.device-type=raspberry-pi2, io.balena.qemu.version=3.0.0+resin-arm, name=musing_zhukovsky)

2019-02-12T07:34:46.195722938-05:00 container die cdcdcc410518db46e09967412bd583c33cff6f4e8eee0f10e8baeec860f9c9a2 (image=295, io.balena.architecture=armv7hf, io.balena.device-type=raspberry-pi2, io.balena.qemu.version=3.0.0+resin-arm, name=musing_zhukovsky)

Es fácil interpretar que después de la fecha y hora del evento, la descripciones “container start” y “container die”, describen el comportamiento que estoy analizando. Estaba un poco mas cerca.

Sin embargo, el evento no presenta mucha información sobre el error. Es por esto, que utilizando el <LOG ID> podemos obtener mas información con el siguiente comando.

sudo docker logs cdcdcc410518db46e09967412bd583c33cff6f4e8eee0f10e8baeec860f9c9a2

02 docker event details

Esto ya es mucho mejor! Ya puedo ver un archivo de código fuente en python y ademas el error, que en este caso, se da al intentar importar el modulo Pillow. Ahora ya puedo abrir python y todo cobra sentido.

03 app python details

Pues bien, ahora solo queda ver las dependencias y herramientas que necesita TensorFlow para instalar las mismas en el orden correcto antes de compilar la imagen.

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi

Windows 10 and YOLOV2 for Object Detection Series

#Docker – Container dies immediately upon successful start in a #RaspberryPi. Of course, it’s all about #TensorFlow dependencies

Hi !

Creating Docker images is a fun process. When I created the CustomVision.ai custom image to be executed in my Raspberry Pi, I faced a couple of errors, so now it’s time to save / share some lessons learned.

One of the most frustrating steps was after my 15 min wait time to build an image to find that the image was successfully built, however it dies after I run the image with a command like this one

sudo docker run -p 127.0.0.1:8080:80 -d <IMAGE ID>

There are a couple of options to understand what’s happen here. I decided to launch and trace the live events from Docker with the command

sudo docker events&

01 docker events

This windows is a full buffer of Docker events, after a while I detected that after I tried to start my docker image I got 2 messages similar to this one

2019-02-12T07:34:46.195722938-05:00 container start cdcdcc410518db46e09967412bd583c33cff6f4e8eee0f10e8baeec860f9c9a2 (image=295, io.balena.architecture=armv7hf, io.balena.device-type=raspberry-pi2, io.balena.qemu.version=3.0.0+resin-arm, name=musing_zhukovsky)

2019-02-12T07:34:46.195722938-05:00 container die cdcdcc410518db46e09967412bd583c33cff6f4e8eee0f10e8baeec860f9c9a2 (image=295, io.balena.architecture=armv7hf, io.balena.device-type=raspberry-pi2, io.balena.qemu.version=3.0.0+resin-arm, name=musing_zhukovsky)

As you probably detected (much faster than me!) the events were container start and container die. But the docker events does not display much more information with details of the event.

What we can use is the <LOG ID> included in the event line. And with the following command we can get more details of the event.

sudo docker logs cdcdcc410518db46e09967412bd583c33cff6f4e8eee0f10e8baeec860f9c9a2

02 docker event details

This is much better! Now I know that we can’t import a Python module named PIL on the file [app.py], in the line 10. When I open the file, it all makes sense.

03 app python details

So now it’s time to check the dependencies and tools required to use TensorFlow in a Raspberry Pi. I’ll write more about this tomorrow 😀

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi

Windows 10 and YOLOV2 for Object Detection Series