Image processing with USB acceleration - all pi! ARCHIVED

Please see earlier comment on multiple targets

OK just published release v0.3 which fixes bounding boxes. Next step is to make an easy way to show the bounding boxed images in HA

1 Like

Nice work on this project. Does anyone know if google coral will run on a Synology? I believe there is a dependency on having hardware/USB driver at the host level - plan to run this in a docker hosted on Synology.

The coral docs state the coral requires:

Any Linux computer with a USB port
Debian 6.0 or higher, or any derivative thereof (such as Ubuntu 10.0+)
System architecture of either x86-64 or ARM32/64 with ARMv8 instruction set

I am not sure if the Synology meets these requirements

In particular, there are some shared libraries provided only in binary form for either x86_64 or raspberry pi , likely for user-mode applications (or python libraries?) I don’t know what the dependency on Linux kernels might be, perhaps whatever means is used to access the USB device. It doesn’t seem like a kernel driver is in the mix here, and I’ve been successful in accessing the Coral USB stick from inside a docker container by passing /dev/bus/usb into the container as a device.

1 Like

Ahhh so coral is not open source?

an update on my side on this component.

currently running v0.3 and testing it with a couple of cameras (M5Stack) for presence detection.
Threshold set to 50 and works pretty well so far: I can turn on/off light based on room presence with this.

Issue is M5Stack are getting too hot and crashing :frowning: (currently running 800x600 resolution, 0.3fps to see if they can sustain the frame rate, previously at 0.5fps was too high during these summer days).
I ordered TTGO Oled+Pir cameras which should not have this issue: if you plan to do something similar avoid cheaper M5Stack camera unless you want simply to experiment.

In terms of “speed of recognition” this is super quick I would say: my Coral stick is on RPI3+ (wired) while HA is running in a separate mini-pc based on Celeron N4100

All-in-all great job so far @robmarkcole!

1 Like

Seems to me that it’s relatively lower-level code to talk to the device. It’s that it’s in user-space talking to /dev/bus/usb/foo rather than some kernel-space driver for your not-open-source USB/RS-232 adapter.

You might grab their software distribution and investigate to see if there’s something missing that you need to be able to use the device. There was also some discussion I read regarding what happens there are multiple models in use, and managing how some portion of what the TPU crunches on could be cached, rather than needed to reload all the stuff every time if you’re switching. That driver is probably the least of the interesting stuff you don’t have access to, like the VHDL for the Coral TPU…

1 Like

hi there,

I was wondering if this project was still alive: I am really using it and thinking it’s great!
can’t wait for next steps! :slight_smile:

Raspberry Pi 4 results look pretty good - https://blog.hackster.io/benchmarking-machine-learning-on-the-new-raspberry-pi-4-model-b-88db9304ce4

Interestingly, the xnor.ai program is nearly as quick as tensorflow + coral stick on a Pi 3 B+

Would love to see some image processing on the Pi 4 itself.

1 Like

Yes still working on this, so many directions I could take it that I am taking the time to choose the right direction :slight_smile:

good point RPI4 with USB3.0 is removing bottleneck for Google Coral Stick.

Coral arrived on Friday and I have set up the Coral Pi Rest Server on a Raspberry 3 B using a clean installation of Stretch Lite with Python 3.5. After a period of inactivity I have to restart the Coral Pi Rest Server with “python3 coral-app.py” because I receive the following error “curl: (7) Failed to connect to xxx.xxx.x.x port 5000: Connection refused”. How can I overcome this problem?

if you are running the script over ssh it is probably timing out

I am new to Python. How would I have run the app, i.e. “python3 coral-app.py”, as my Raspberry is headless and I have to connect via ssh from my laptop?

Would I have to run “python3 coral-app.py” as a service?

Essentially, that’s the effect you want. What this means in the Linux world is that the process you start isn’t connected to an interactive session. If your SSH session times out or is disconnected, then all of the processes started by it (“in that terminal process group”) will get a hang-up (“SIGHUP”) UNIX signal sent to them which probably cause them to exit. Or the standard input/output is no longer valid and an error occurs next time it tries to write to it.

You can start it manually using a tool like daemon which does the extra stuff to isolate it from your terminal session, or have the system start it as a service with using systemd when it boots. Maybe start by looking at https://www.raspberrypi.org/documentation/linux/usage/systemd.md for example.

You can also use nohup

1 Like

Thank you for the advice on “nohup” it solved my problem.

1 Like

For completeness I mention screen. You’ll find lots of howtos, but essentially if your session disappears (eg you log out or your ssh session gets interrupted) then any process running under screen stays alive and can be reconnected to.