Cheers @janjongboom! Nice to have a proper reference
Hey @janjongboom, I’m thinking about implementing the code above soon on my RPi4. Am I right in thinking that I first need to install the model from Edge Impulse onto my device, then run that code on my RPi4?
Is there a particular order that things should be done in? If so, could you list what I need to be aware of please? I’ve got my model running at about 85.5%-90% accuracy for something vs nothing now, so I need to go field test it
So, I’ve tried to run a mix of the above code but I’m getting an error right at the start of the example when trying to import “EdgeImpulseRunner”, see below for error:
Traceback (most recent call last):
File “processor.py”, line 7, in
from edge_impulse_linux.image import ImageImpulseRunner
ImportError: No module named edge_impulse_linux.image
Any ideas on why it’s not finding the image at all? Am I missing something from my installation perhaps? Any advice would be appreciated.
Hope you had a nice weekend
Hi @TechDevTom,
Have you installed the Python package first?
pip3 install edge_impulse_linux
Aurelien
Hey @aurel, I thought I had, but just to make sure I ran that line of code again to make sure I wasn’t mistaken. It looks like it might have installed a couple of different associated packages, but when I try to run the code again I’m having no luck, I still get the same error.
If it were a line of code later on I could probably figure out how to fix it myself (probably), but since this is in direct relation to the edge impulse linux image I don’t know where to start!
Hey @louis @janjongboom, I’m using Python version 3.7.3 and pip version 18.1
Are there specific versions that I should be using? Do I need to place the python code in a specific location for it to work, or can it be placed anywhere on the SD card that I’m using?
Thanks for the assist so far!
Could you provide the full output of the commands mentioned by Jan?
If you have multiple Python3 versions installed, pip3 may be pointing out to another version than 3.7.3.
Thanks,
Aurelien
@aurel @janjongboom Here you go, and, interestingly enough, on the pip3 command it mentions python 3.7, rather than python 3.7.3 at the end of it. Could this be an issue, or is just not printing out the full version?
Hey @TechDevTom,
Do you also have python 2 installed on your RPi? Can you make sure you run your python code using python 3. Otherwise, I am kind of running out of suggestion
Maybe try removing python & pip and do a clean install again to see if that fixes it.
Let us know of it goes.
Louis
Hi @TechDevTom you can try:
python3 -m pip install edge_impulse_linux
To make sure it’s the matching Python version (for some f*n reason I have 8 different Pythons on my work laptop all with their own list of packages, so I feel your pain).
@louis @janjongboom Apparently I DID have Python 2 installed on my RPi! Annoying! I followed the advice on this link by Seamus and the code runs now: https://raspberrypi.stackexchange.com/questions/118760/uninstall-python2-in-raspberry-pi
Should I be feeding arguments into the command when I run it?
Never mind, got it, working nicely I think, thanks guys! Now to run some images through it and get it into the weatherproof case
Will keep you informed of my progress if you want!
Hey all, just wanted to say that I’ve had good success over the last two days of running my model! I’ve gathered more data for making the model a bit more accurate (plant pots are not animals) and have been training the model as I go along.
I’ve hit a snag though, so will post a new topic up for that so others can find it easily if they run into a similar issue.
@janjongboom @aurel Hey guys, quick question, I notice that the image is cropped using the “runner.get_features_from_image(img)” call. Is there any way to process the entire image?
I’ve got code running to draw bounding boxes around birds that are detected by motion using cv2, but sometimes the bird is on the edge of the screen, and as I’m drawing bounding boxes around the “processed” image, the bird is no longer in screen!
Any help would be appreciated! I’m getting some really good shots with the camera btw, see attached The Blackbird shot didn’t actually come through as a “something”, it came through as a nothing. I must need more bird close ups haha!
The two Bullfinches were a surprise, as I had one in earlier in the year but didn’t know I had a pair in. This is a good example of how the cropping effects the overall box drawn image though. It’s cutting out the Bullfinch on the left
The pigeon shot is a good demo of the box drawing I have going on though!

The issue is that the model is trained on square images (and we don’t support non-square for now). One way around this would be to slice the image from webcam into two images and classify them both to not miss anything.
Here’s an example: https://github.com/edgeimpulse/linux-sdk-python/blob/master/examples/image/classify-full-frame.py
(You’ll need to upgrade to 1.0.4 of the Python package)
Ah I see, darn! I’ll give that split image thing a go, quite handy. I might need to analyse full images at some point in the future in one shot though, are there any plans to develop this ability @janjongboom?
I’m using the Object Detection code I’ve written to crop images down for the Image Classification section of the app, very handy
@TechDevTom For normal image classification you can already do it, but we only have square object detection models available for now - most research is also going into square images, so I wouldn’t expect this to change very soon (cc @dansitu)