Hey everyone! I was excited to see Linux SBC support drop a few weeks back and have been working on a project using Edge Impulse to perform image classification on an analog pressure gauge using the Pi and Pi camera v2. My model is tuned pretty well and I am happy with the results, but I am seeing different results when using the Python SDK vs edge-impulse-linux-runner
.
Here’s what I am seeing when using the Python SDK runner.classifier
with the output dict sorted and reversed so the “winner” comes out on to (note that tank-pressure-low
is inferred as the most-likely result):
classification runner response
[('tank-pressure-low', 0.9246085286140442), ('tank-pressure-off', 0.03462480753660202), ('tank-pressure-high', 0.03320816159248352), ('tank-pressure-normal', 0.007558567449450493)]
classification runner response
[('tank-pressure-low', 0.922396719455719), ('tank-pressure-off', 0.04392895847558975), ('tank-pressure-high', 0.023367837071418762), ('tank-pressure-normal', 0.010306425392627716)]
classification runner response
[('tank-pressure-low', 0.928776204586029), ('tank-pressure-off', 0.04399576783180237), ('tank-pressure-high', 0.015807965770363808), ('tank-pressure-normal', 0.011420144699513912)]
classification runner response
[('tank-pressure-low', 0.9372159838676453), ('tank-pressure-off', 0.04013027250766754), ('tank-pressure-normal', 0.012561420910060406), ('tank-pressure-high', 0.010092317126691341)]
classification runner response
[('tank-pressure-low', 0.9334703683853149), ('tank-pressure-off', 0.043883539736270905), ('tank-pressure-normal', 0.016150416806340218), ('tank-pressure-high', 0.006495747249573469)]
And here’s what I get when I run that exact some model using edge-impulse-linux-runner
(note that tank-pressure-normal
is inferred as the most likely result:
classifyRes 38ms. {
'tank-pressure-high': '0.0008',
'tank-pressure-low': '0.0001',
'tank-pressure-normal': '0.9989',
'tank-pressure-off': '0.0002'
}
classifyRes 13ms. {
'tank-pressure-high': '0.0007',
'tank-pressure-low': '0.0001',
'tank-pressure-normal': '0.9991',
'tank-pressure-off': '0.0002'
}
classifyRes 15ms. {
'tank-pressure-high': '0.0006',
'tank-pressure-low': '0.0002',
'tank-pressure-normal': '0.9991',
'tank-pressure-off': '0.0002'
}
classifyRes 17ms. {
'tank-pressure-high': '0.0004',
'tank-pressure-low': '0.0001',
'tank-pressure-normal': '0.9994',
'tank-pressure-off': '0.0001'
}
classifyRes 11ms. {
'tank-pressure-high': '0.0002',
'tank-pressure-low': '0.0001',
'tank-pressure-normal': '0.9996',
'tank-pressure-off': '0.0001'
}
The CLI is giving me the correct, expected result and the Python SDK is not. I have run these one after another and nothing has changed about the placement of the camera, gauge, or anything else.
I can dig deeper into the Python SDK to see if there’s an issue there, but I figured I’d post here in case I am doing something wrong. I’m using the image classifier example.