Do you know IBM MAX? A service provided by IBM that can connect deep-learned models with REST API can be used as a Docker-compatible container. You can also call it from Node-RED. From around November 2019, it has become compatible with IoT devices and embedded devices equipped with ARM CPUs including Raspberry Pi, and PCs with ARM CPUs, so in this article, IBM MAX will be used using Raspberry Pi. Check the operation of the Object Detector. It's best to look at the references to see what you can do with IBM MAX.
Follow the "Run Locally" procedure on Github for the IBM MAX Object Detector. I want to start the Object Detector container automatically, so I've added some arrangements.
IBM MAX runs as a container, so install Docker by executing the following command.
$ curl -sSL https://get.docker.com | sh
$ sudo usermod -aG docker pi
$ sudo systemctl start docker
After execution, log out once so that the docker command can be executed by the pi user of Raspberry Pi. Log in again to continue working.
Get the files needed to prepare a container for Raspberry Pi from Github and build (generate a container).
$ git clone https://github.com/IBM/MAX-Object-Detector.git
$ cd MAX-Object-Detector/
$ docker build -f Dockerfile.arm32v7 -t max-object-detector .
Check the built container image. The container image allows you to run the version of the software at the time you built it at any time. Great for reproducibility!
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
max-object-detector latest be165b81e855 5 minutes ago 1.55GB
codait/max-base arm-arm32v7-latest 110efb51671f 4 days ago 742MB
Start the container and check the operation. Start the container image "max-object-detector" as a container named "max-object-detector".
$ docker run --name max-object-detector -itd -p 5000:5000 max-object-detector
In your web browser, go to http://raspberrypi.local:5000/app/ and you'll see the Object Detector web application.
There is Sample image data on Github, so download some and use "Upload an Image" of the web application. Check if the image can be identified.
The Raspberry Pi used to check the operation is 3B +. It will take some time as it has only 1GB of memory. The Raspberry Pi 4 has 2GB and 4GB memory models, so that is faster.
You have now run the IBM MAX Object Detector on your Raspberry Pi. With a little extra work, make sure the container is always running.
$ sudo systemctl enable docker
$ docker update --restart=always max-object-detector
Restart your Raspberry Pi and check if you can access http://raspberrypi.local:5000/app/ in your web browser. If it is displayed successfully, it means that the container has started automatically.
You have now confirmed that IBM MAX can use deep-learned models as REST services on your office or home server. In addition to the Object Detector, IBM MAX comes in a variety of models. The license is "Apache License 2.0", so it can be used for commercial purposes.
Related information etc. IBM DAX Along with IBM MAX, there is also DAX. IBM MAX makes it easy to use deep-learned models as docker containers, including interfaces for REST services. IBM DAX is an abbreviation for Data Asset eXchange, which provides open data for deep learning. When trying to create an AI service using deep learning, collecting data is the most difficult, so it would be a great help.
Watson Anywhere "Watson Anywhere" announced at THINK 2019. As of December 2019, by using IBM Cloud Pak for Data, Watson can be used both on-premises and on AWS other than IBM Cloud. Even Watson is an on-premise AI! (Although the public version has a free plan and is easy.)
Recommended Posts