Raspberry camera

Im currently working with this code
to run my FOMO.EIM model on a Raspberry Pi. Since I am using a PiCam, I attempted to modify the code to work with my specific camera. However, I encountered an error in the process. I have tried multiple solutions to resolve the issue but have been unsuccessful so far. Has anyone else encountered a similar problem?

The camera is functioning properly. When I connect it to Edge Impulse, it works flawlessly.

It looks like you are running out of RAM. At the top of the file try show_camera = False.

1 Like

I’ve also tried it your way, but it didn’t work for me
For me it worked that I took the image with a seperate python script, which returns me the image and then initialize the runner with:

runner = ImageImpulseRunner(modelfile)

then get the information from the runner by running:

model_info = runner.init()
runner = ImageImpulseRunner(modelfile)

after that get the features from the image and the interference results with:

features, cropped = runner.get_features_from_image(img)
res = runner.classify(features)

In general:
Take the image seperatly and then classify it.


Glad to see you got a working solution!

You might want to compare your solution with this EI solution that takes the model and filename as arguments to main().

1 Like