Page 2 of 5

Re: zmevennotification object detection on edge tpu

Posted: Sat Nov 21, 2020 11:33 am
by Magic919
Now it’s getting dark earlier I find the TPU results are pretty hilarious in the dark. It recognised a rock as a person. I went back to CPU.

Re: zmevennotification object detection on edge tpu

Posted: Sat Nov 21, 2020 4:10 pm
by asker
So do you think possible on mlapi to use YoloVx only after MobileNetSSDV2 if MobileNetSSDV2 return nothing or no patern filter

[objectfirst]
[objectsecond]only if first failed

Thanks
Not yet, but the plumbing is already in place.
The new version of pyzm allows you to:
a) chain models and fallback to different ones
b) Analyze arbitrary frames
c) Select based on multiple criteria (example within a given pattern, match the most objects, or most unique objects etc)

https://github.com/pliablepixels/pyzm/b ... /stream.py

If you are comfortable experimenting in python, you can code this out yourself as well using pyzm.

What is done so far: the hard part - the chaining/streaming/filtering/detection (80% of the work)
What is left: integrating with zm_detect and mlapi (20% of the work)

Of course, the 20% I'm not finding time for

Re: zmevennotification object detection on edge tpu

Posted: Sat Nov 21, 2020 7:19 pm
by fennec
ok thanks little experience on python

i see that

thanks

Re: zmevennotification object detection on edge tpu

Posted: Sat Nov 28, 2020 12:16 pm
by fennec
do you try another models ?

https://coral.ai/models/

all model works in Input size: 224x224

but no resize for height |---------- TPU (input image: 224w*125h) ----------|

Normal ?

Re: zmevennotification object detection on edge tpu

Posted: Tue Jan 05, 2021 8:46 pm
by VicThor
https://coral.ai/news/updates-11-2020/

Has anyone tried MobileDet SSD ?
How does it compare to yolo ?

Re: zmevennotification object detection on edge tpu

Posted: Wed Jan 06, 2021 1:42 am
by VicThor
I guess I can answer my own question :)
The new library will break zmeventnotification as it removes python3-edgetpu

sudo apt-get install python3-pycoral
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libedgetpu1-std python3-tflite-runtime
The following packages will be REMOVED:
python3-edgetpu
The following NEW packages will be installed:
python3-pycoral python3-tflite-runtime
The following packages will be upgraded:
libedgetpu1-std

Which will break zmdetect:

/zm_detect.py[1931]: FAT [zmesdetect_m3] [Unrecoverable error:No module named 'edgetpu' Traceback:Traceback (most recent call last):#012 File "/var/lib/zmeventnotification/bin/zm_detect.py", line 849, in <module>#012 main_handler()#012 File "/var/lib/zmeventnotification/bin/zm_detect.py", line 321, in main_handler#012 m = object_detection.Object(logger=g.logger, options=g.config)#012 File "/usr/local/lib/python3.8/dist-packages/pyzm/ml/object.py", line 30, in __init__#012 import pyzm.ml.coral_edgetpu as tpu#012 File "/usr/local/lib/python3.8/dist-packages/pyzm/ml/coral_edgetpu.py", line 14, in <module>#012 from edgetpu.detection.engine import DetectionEngine#012ModuleNotFoundError: No module named 'edgetpu'#012]

Re: zmevennotification object detection on edge tpu

Posted: Wed Jan 06, 2021 2:19 am
by asker
You seem to be using an old version. The new stable versions use the new libraries.
And I just switched to the new model - It seems to be faster, but not sure it is any better

Re: zmevennotification object detection on edge tpu

Posted: Wed Jan 06, 2021 8:24 pm
by VicThor
Thanks asker, will give it a go.

Re: zmevennotification object detection on edge tpu

Posted: Thu Jan 07, 2021 11:55 pm
by VicThor
It seems to work much better than previous library and models.
However it creates way too many polygons for the same object.

Re: zmevennotification object detection on edge tpu

Posted: Sat Jan 09, 2021 12:00 pm
by asker
VicThor wrote: Thu Jan 07, 2021 11:55 pm It seems to work much better than previous library and models.
However it creates way too many polygons for the same object.
Can you post an example? I'm not seeing that issue of multiple polygons compared to the old model.

Re: zmevennotification object detection on edge tpu

Posted: Sat Jan 09, 2021 7:46 pm
by VicThor
Here is an example where not only wrongly detected but it's all over the place :D

https://i.postimg.cc/52zNv5vT/4-227763-0.jpg

Re: zmevennotification object detection on edge tpu

Posted: Sat Jan 09, 2021 10:04 pm
by asker
Can you link to the original image without the boxes so I can test?

Re: zmevennotification object detection on edge tpu

Posted: Sat Jan 09, 2021 10:44 pm
by VicThor
Thanks asker.

Here is the original:
https://i.postimg.cc/s266rLDZ/4-227763-101.jpg

Re: zmevennotification object detection on edge tpu

Posted: Sun Jan 10, 2021 12:32 am
by asker
This is an interesting one. You're right, the new model goes all over the place. Interestingly when I first ran it, it came out perfectly as a dog, but then I realized I had my config as:

a) First run TPU at 0.6 confidence
b) Then run YoloV4 at 0.3 confidence

So this filtered out all the boxes in your image.

I've realized, in my case, if I keep TPU threshold to 0.6, I do away with most of the useless things and I fallback to Yolov4 if TPU fails.

Re: zmevennotification object detection on edge tpu

Posted: Sun Jan 10, 2021 3:01 am
by VicThor
Thanks asker, that's really good. I will have to modify my objectconfig accordingly to the new way.
Is it possible you can put your config here? Or the important bits :)