Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ARM #72

Closed
corvy opened this issue Oct 17, 2019 · 14 comments
Closed

Support for ARM #72

corvy opened this issue Oct 17, 2019 · 14 comments

Comments

@corvy
Copy link

corvy commented Oct 17, 2019

Hello, will you add support for ARM CPU so we can run it on for instance Raspberry Pi 4? Is there a guide to build it manually for RPI4? I tried the run locally but it fails due to usage of some prebuilt binaries not supported on arm.

@bdwyer2
Copy link

bdwyer2 commented Oct 17, 2019

Hi @corvy it would be awesome to be able to run MAX models on a Raspberry Pi. We would need to change the base image in order to do this and we already have an issue open for that (IBM/MAX-Base#6).

@corvy
Copy link
Author

corvy commented Oct 17, 2019

Perfect, thanks for swift reply @bdwyer2.
Is there any progress on this considering the issue is 10 months old? Is there any way to build this manually that you know of.

@bdwyer2
Copy link

bdwyer2 commented Oct 17, 2019

The easiest thing to do would be to install the requirements and run the code in this repo directly on the Raspberry Pi outside of Docker.

If you want you can join our slack workspace and we can walk you through the steps.

@corvy
Copy link
Author

corvy commented Oct 17, 2019

Great, I will do this, but stil I want it on docker as I have other workloads on the same Pi running. This is to become an appliance type device for automation and monitoring of a boat. ⚓🤠

Let me look into it and I will join slack over the next few days.

@bdwyer2
Copy link

bdwyer2 commented Oct 17, 2019

Oh cool! What kind of boat? I would love to learn more about what you are doing

@corvy
Copy link
Author

corvy commented Oct 18, 2019

I have been using Home Assistant on the boat for a few years. My setup includes the use of Hass.IO, Node-Red, InfluxDB, MQTT, SignalK and ZigBee ZHA. This enable the use of sensors like water leak, vibration, temperature, moisture and various switches. I use Node-Red for automation of the battery charging and solar charge monitoring. There is a Victron battery monitor and MPPT solar charge controller, both which are connected to the Pi with USB serial cables. These feed data to Node-Red and automate the charge of my LiFePo4 battery bank. SignalK is reading NMEA data from my AIS tranceiver which provides location information (GPS). The network is provided by a WiFi router with SIM CARD and 4G support.

Also I have two cameras setup, currently using Dafang Hacked Xiaomi cameras. This summer I migrated to a Raspberry Pi 4 and I want to integrate my cameras with Tensorflow to reduce the false-positive motion messages. On a boat there is allways some motion, but 99% of this is not interesting so I need to use some ML to make sure I only get interesting alerting. Cloud integration is of course an option as long as I only use capture single images but if I could retain it all on the Pi I save data on my GSM SIM card.

Functionality that I am working at is for instance:

Working:

  • Alarm when the boat is moving more than 0,2 knots and the alarm is on
  • Alarm if water in the bilge
  • Alarm if motion on the camera, with sending a snapshot (HTML5 and Hangouts used for notification) - many false positives currently
  • Battery charging to target set in the UI. If target is 70% it charges to 70%, when the charge falls to 67% (-3%) then charge back to target.
  • Turn off/on dehumidifier from app
  • Turn off/on water heater
  • Show battery charge state
  • Show current usage/charge
  • Show Solar panel charge

In progress:

  • Alarm when vibration and the alarm is on
  • Alarm if battery lower than 20% / user configurable
  • Alarm if motion on cameras only by people
  • Alarm if moisture above x level (60%?)
  • Waste tank fill sensor (ESP sensor, ultrasonic)
  • Automate webasto heater
  • Automate aircondition control (ESP perhaps?)

So ... a lot of ideas still :)

Screenshot 2019-10-18 07 35 57

@bdwyer2
Copy link

bdwyer2 commented Nov 12, 2019

Hi @corvy if you change FROM codait/max-base:v1.1.3 to FROM codait/max-base:arm-arm32v7-v1.3.0 in the Dockerfile and tensorflow==1.12.2 to tensorflow==1.13.1 in requirements.txt you should be able to run this model on a Raspberry Pi. I've tested this on a Raspberry Pi 4 and it works

@corvy
Copy link
Author

corvy commented Nov 12, 2019

Ok, I will give it a go :) Thanks!

@corvy
Copy link
Author

corvy commented Nov 12, 2019

It works! :) Just created an image with your suggested changes and uploaded to the docker hub registry.

https://hub.docker.com/repository/docker/sbarmen/max-object-detector

Note I had to pull from console on portainer. Timeout problem? Took 10-15 minutes to pull it. This is a working solution for me! Thanks @bdwyer2 👍

Screenshot 2019-11-12 16 28 06

@corvy corvy closed this as completed Nov 12, 2019
@bdwyer2
Copy link

bdwyer2 commented Nov 12, 2019

Glad you got it working. We hope to iron out the bugs and have an official build soon.

@corvy
Copy link
Author

corvy commented Nov 12, 2019

Perfect 👍 we should maybe consider a model specifically for low performance systems with less resource requirements. I am looking forward to trying some of the pretrained models. Right now it uses 10-15 seconds and for instance restrictions to only detection of humans would perhaps reduce the processing time?

@bdwyer2
Copy link

bdwyer2 commented Nov 14, 2019

You can now pull directly from docker hub

docker pull codait/max-object-detector:arm-arm32v7-latest

@corvy
Copy link
Author

corvy commented Nov 15, 2019

Grand @bdwyer2. Will you keep updating this going forward?

@xuhdev
Copy link
Contributor

xuhdev commented Nov 15, 2019

We have set up CI for ARM. I think we will in the foreseeable future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants