[PYTHON] Since IBM MAX supports ARM, it runs on Raspberry Pi.

Overview

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.

Run on Raspberry Pi

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.

Put Docker on Raspberry Pi

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.

Build a container for IBM MAX Object Detector

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

Operation check

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. image.png

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. image.png

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.

Other

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.)

Reference material

Recommended Posts

Since IBM MAX supports ARM, it runs on Raspberry Pi.
Introduced Ceph on Kubernetes on Raspberry Pi 4B (ARM64)
pigpio on Raspberry pi
Cython on Raspberry Pi
[Note] Installing vmware ESXi on Arm Fling on Raspberry Pi 4B
Introduced pyenv on Raspberry Pi
Use NeoPixel on Raspberry Pi
Install OpenCV4 on Raspberry Pi 3
Install TensorFlow 1.15.0 on Raspberry Pi
Testing uart communication on Raspberry Pi
MQTT on Raspberry Pi and Mac
raspberry pi 4 centos7 install on docker
Install ghoto2 on Raspberry Pi (memo)
Try using ArUco on Raspberry Pi
OpenCV installation procedure on Raspberry Pi
Power on / off Raspberry pi on Arduino
Detect switch status on Raspberry Pi 3
Install OpenMedia Vault 5 on Raspberry Pi 4
L Chika on Raspberry Pi C #
Build wxPython on Ubuntu 20.04 on raspberry pi 4
"Honwaka Notification Lamp" on Raspberry Pi Part 2
Detect "brightness" using python on Raspberry Pi 3!
USB boot on Raspberry Pi 4 Model B
Adafruit Python BluefruitLE works on Raspberry Pi.
Set swap space on Ubuntu on Raspberry Pi
Use the Grove sensor on the Raspberry Pi
Install docker-compose on 64-bit Raspberry Pi OS
Run servomotor on Raspberry Pi 3 using python
"Honwaka Notification Lamp" on Raspberry Pi Part 3
Working with sensors on Mathematica on Raspberry Pi
Build OpenCV-Python environment on Raspberry Pi B +
Detect temperature using python on Raspberry Pi 3!
Mount Windows shared folder on Raspberry Pi
Matrix multiplication on Raspberry Pi GPU (Part 2)
How to install NumPy on Raspberry Pi
I installed OpenCV-Python on my Raspberry Pi
Working with GPS on Raspberry Pi 3 Python
Make a thermometer with Raspberry Pi and make it visible on the browser Part 3
Use python on Raspberry Pi 3 and turn on the LED when it gets dark!