#CustomVision – Compilar el proyecto de CustomVision en #Docker en una #RaspberryPi

Buenas !

Después de compilar y utilizar el modelo exportado de CustomVision.ai en Windows y Linux, el siguiente paso es intentarlo en una RaspberryPi (RPI). Desde hace un tiempo RPI soporta docker, así que intentare tomar la imagen de Linux y modificar la misma para que funcione en la RPI.

Este es el contenido del [DockerFile] original que se ha exportado para Linux

FROM python:3.5

ADD app /app

RUN pip install --upgrade pip
RUN pip install -r /app/requirements.txt

# Expose the port
EXPOSE 80

# Set the working directory
WORKDIR /app

# Run the flask server for the endpoints
CMD python app.py

En este archivo se utiliza una imagen base de python 3.5 para Linux. Navegando en los repositorios de Docker Hub y leyendo en la comunidad de Docker, he encontrado algunas imágenes base para RPI de Balena (link), see references.

La imagen que utilizare se llama [balenalib/raspberrypi3]. La misma solo posee Linux, sin nada de software instalado. Me he basado en parte  de los ejemplos de [Custom Vision + Azure IoT Edge on a Raspberry Pi 3] para instalar a mano el software necesario para que un proyecto de CustomVision.ai funcione en RPI.

FROM balenalib/raspberrypi3

RUN apt-get update &&  apt-get install -y \
        python3 \
        python3-pip \
        build-essential \
        python3-dev \
        libopenjp2-7-dev \
        libtiff5-dev \
        zlib1g-dev \
        libjpeg-dev \
        libatlas-base-dev \
        wget 

RUN pip3 install --upgrade pip 
RUN pip3 install pillow numpy flask tensorflow

RUN pip3 install flask 
RUN pip3 install pillow
RUN pip3 install numpy
RUN pip3 install tensorflow

ADD app /app

EXPOSE 80

WORKDIR /app

CMD python3 app.py

El proceso completo de compilación de la imagen en la RPI tarda unos 10 o 15 minutos, así que es la excusa perfecta para tomar un café, un te, o lo que gustes.

01 docker raspberry pi build

Una vez que el proceso esta completo, ya podemos ver la imagen en la lista de imágenes locales en Docker en RPI. Es el momento de ejecutar la misma, en el puerto 8080

02 docker raspberry pi image built

Y utilizando un comando cURL podemos probar el análisis de la imagen en local en la RPI!

01 raspberry pi docker image analyzed

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

Windows 10 and YOLOV2 for Object Detection Series

Advertisements

#CustomVision – Building the CustomVision project in #Docker in a #RaspberryPi

Hi !

So my next step in my build process is to host the CustomVision.ai exported model in a RaspberryPi (RPI). RPI supports docker, so it should be easy to work with the exported Linux image.

So let’s take a look at the original [DockerFile] in the Linux export

FROM python:3.5

ADD app /app

RUN pip install --upgrade pip
RUN pip install -r /app/requirements.txt

# Expose the port
EXPOSE 80

# Set the working directory
WORKDIR /app

# Run the flask server for the endpoints
CMD python app.py

This file uses a standard python 3.5 linux image as base. However browsing in the docker community, I found a specific set of base image for RaspberryPi in the Docker Hub from Balena (link), see references.

So, using this base image and some resources from [Custom Vision + Azure IoT Edge on a Raspberry Pi 3] I make some changes to the DockerFile to create a running image for RPI.

FROM balenalib/raspberrypi3

RUN apt-get update &&  apt-get install -y \
        python3 \
        python3-pip \
        build-essential \
        python3-dev \
        libopenjp2-7-dev \
        libtiff5-dev \
        zlib1g-dev \
        libjpeg-dev \
        libatlas-base-dev \
        wget 

RUN pip3 install --upgrade pip 
RUN pip3 install pillow numpy flask tensorflow

RUN pip3 install flask 
RUN pip3 install pillow
RUN pip3 install numpy
RUN pip3 install tensorflow

ADD app /app

EXPOSE 80

WORKDIR /app

CMD python3 app.py

The full build process takes a couple of minutes, so you may want to have a coffee or a tea during the build process.

01 docker raspberry pi build

Once the process is complete, we can find the built and run the image from the docker image list

02 docker raspberry pi image built

Next step is to try the remote container with a single cURL command and done!

01 raspberry pi docker image analyzed

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

Windows 10 and YOLOV2 for Object Detection Series

#Event – I’ll be at @CodeMash on Ohio in 17 days sharing some #AI and #CustomVision experiences

codemash-logo

Hi!

I’m going to be part of one of the most amazing developer events in NA: CodeMash (http://www.codemash.org/). It will be my first time in Ohio, and also it will be an amazing opportunity to network and have some face-to-face chats with some amazing people. (Just look at the Speaker List)

I was also lucky to host a session around Artificial Intelligence with Cognitive Services at Enterprise Level. The latest announcements of containers and Cognitive Services are ready on time for this!

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

It all started with a DIY project to use Computer Vision for security cameras at home. A custom Machine Learning model is the core component used to analyze pictures to detect people, animals and more in a house environment. The AI processing is performed at the edge, in dedicated hardware and the collected information is stored in the cloud.
The same idea can be applied to several CCTV scenarios, like parking lots, train stations, malls and more. However, moving this into enterprise scale brings a set of challenges, which are going to be described and explained in this session.

Session List: http://www.codemash.org/session-list/

Happy coding and see you there!

Greetings @ Toronto

El Bruno

#Windows10 – IoT Core, first look to IoT Dashboard, Device Portal and Remote Client

Hello!

After review some of the updates for Windows 10 IoT Core, I realized the new app for managing Windows 10 IoT Core devices is great.

Setup a new Device

The creation of the image to the SD card that will be used in a device is quite simple. From the following view we can

  • Select the type of Raspberry Pi 2 or 3, Minnoboard Max, Qualcomm Dragon Board 410 c or custom
  • Select the version of OS that you want to use, stable or prereleases
  • Select the disk where you want to save this image
  • Define the name of the device and set the password if you want to use one

image

Once we have defined these values, in few minutes you can have our SD list to use.

My Devices

The next step is to initialize the device. The main constrains here is to be in the same network, once we are in the same network can see the devices in the [My Devices] section.

image

In each device, we will be able to

  • Open the device management portal
  • Launch PowerShell
  • Open a network share against the device
  • Copy your IP address or name
  • Access the settings to change the name

image

Device Portal

This section deserves a full post, there are plenty of new options, which are very useful.

image

I share some of which are more useful

  • Pair BlueTooth devices directly from the portal

image

  • Define network profiles and connect to WiFi networks

image

  • Access and download updates from Windows Update for Windows 10 IoT Core

image

  • Configure a hotspot for sharing internet access directly from the device

image

  • Configure TPM and finally launch the remote client

Remote Client

One of the most interesting options we have in this version is the ability to have a Remote Client for our device. This remote client is a Universal App called Windows IoT Remote Client

image

Once launched the app, we can use the name or the IP address of our device to connect

image

And once connected, we have total control of what shows our device.

image

I think that is a new review of the most interesting stuff.

And, yes, the AZURE section also deserves a separate post.

Greetings @ Toronto

El Bruno

References

#Windows10 – What’s new in #IoT Core version

Clipboard02

Hi !

Windows 10 Anniversary Update is here and there are lot of news to write about. I’ve already wrote about some of the new Hololens features, and I need to write down also some important topics related to Windows 10 IoT Core and Anniversary Update.

So let’s start with the basis: the main image and news are always focused on Raspberry Pi 3, however the Anniversary Update will also work with the MinnowMax, Raspberry Pi 2, and DragonBoard 410c developer boards. The new Getting Started section is a really nice step by step tutorial to setup the device much faster.

And finally, my selected set of top new features are:


  • Windows IoT Remote Client – remote into your IoT device to control and view what is displayed on your IoT device from your desktop or phone
  • Store integration – connect Windows 10 IoT Core to the store to service applications
  • Better Azure IoT Hub connectivity – provision your device with a device identity in the cloud

 

Greetings @ Toronto

El Bruno

References

#Windows10 – Novedades en Anniversary Update para #IoT Core

Clipboard02

Hola !

Windows 10 Anniversary Update ha sido desplegada hace un par de semanas y claro, hay mucho que escribir al respecto. Ya he escrito un poco sobre las novedades para Hololens, y ahora es el momento de comentar (y dejarme apuntado) lo que tenemos para el mundo IoT, es decir para Windows 10 IoT Core con Anniversary Update.

Como siempre empiezo por lo básico: si bien en todos lados siempre aparece una Raspberry Pi 3 como el centro de atención para Windows 10, las novedades de Anniversary Update también aplican para MinnowMax, Raspberry Pi 2, y DragonBoard 410c . Algo que me ha llamado la atención es que la nueva sección Getting Started es muy buena para comenzar con Windows 10 IoT core.

Y finalmente, my selección de las mejores novedades son:


  • Windows IoT Remote Client – ahora tenemos la capacidad de controlar remotamente nuestro dispositivo desde un desktop o smartphone
  • Store integration – por fin! soporte para Microsoft Store en un device IoT, esto abre el mercado para crear y publicar muchas apps !
  • Better Azure IoT Hub connectivity – tengo que estudiar mas a fondo los detalles y seguramente escribire un poco al respecto. En un resumen muy rapido, hay mejoras importantes mejoras en los metodos de integracion Azure, comparados con los que teniamos ahora

Saludos @ Toronto

El Bruno

References

#Podcast – All in: #Windows10, #RaspberryPi, #VisualStudio y #Karts!

Clipboard01

Hola !

Desde Toronto, sigo probando y buscando la manera de colaborar con las comunidades de España y Latino américa en remoto. Ahora que ya tento mi propio canal en Channel9, es tiempo de probar algo en lo que soy completamente novato: Podcasts.

En el episodio de hoy (no se si episodio es e término correcto) estaré hablando con Francisco Javier Fernández Piatek y Marcelo Villacorta Moreno sobre un proyecto más que interesante en el que han participado ambos. Solo decir que involucra Visual Studio 2015, Windows 10 IoT Core y Raspberry Pi es genial, aunque si además el contexto son carreras de Karts, solo puede ir a mejor!

El audio está disponible en iVoox en este link.

 

Saludos @ Toronto

-El Bruno

References

#Podcast – Empezamos con todo: #Windows10, #RaspberryPi, #VisualStudio y #Karts!

Clipboard01

Hi !

So, I’ll continue testing different ways to collaborate with the Spanish Technology community. I already have my own channel in Channel9, so now is time to try something completely new for me: Podcasts.

In today episode I’m talking with Francisco Javier Fernández Piatek and Marcelo Villacorta Moreno about a very cool project of them, which involves Visual Studio 2015, Windows 10 IoT Core, Raspberry Pi and the general context is Karts!

The audio is available in iVoox in this link.

Disclaimer: The audio is in Spanish, is a nice bunch of people are interested in the stuff, I can try to get Francisco and Marcelo one more time and make one in English.

Greetings @ Toronto

-El Bruno

References

#IoT – Novedades en #Raspberry Pi 3

rpi3

Hola !

Días agitados en Toronto, entre la nieve y los primeros pasos en Avanade Canada, me estoy quedando atrasado con los posts que tengo pendiente. Por ejemplo, necesito internet @home para poder terminar mis demos sobre Azure-Garmin, así que aprovecharé para hablar de un notición de hace un par de días: el lanzamiento de Raspberry Pi 3.

Un par de detalles interesantes sobre el device

  • Nueva arquitectura: 64-bit processor, casi un 50% más rápido que Raspberry Pi 2
  • Conectividad integradada, ahora con 802.11n WiFi y Bluetooth 4.1
  • Compatibilidad completa con Raspberry Pi 1 y 2
  • El precio $35 !

 

Si quieres probar Windows 10 IoT Core, o alguna otra cosa compatible con Raspberry Pi, este es el momento de comprar una online !!!

Greetings @ Toronto

-El Bruno

References

#IoT – What’s new in #Raspberry Pi 3

rpi3

Hi !

These are busy days i my first days @Avanade Canada, so I’m kind of behind in my posts. Later I’ll finish my Azure-Garmin demos, my focus on today will be the launch of the new Raspberry Pi 3.

Cool stuff about the device

  • New architecture: 64-bit processor, almost 50% faster than Raspberry Pi 2
  • New connections, 802.11n WiFi and Bluetooth 4.1
  • Complete compatibility with Raspberry Pi 1 and 2
  • Price $35 !

 

So, if you want to play around with Windows 10 IoT Core, or do some other cool stuff, you must order yours now !!!

Greetings @ Toronto

-El Bruno

References