emgucv / emgutf

Emgu TF is a cross platform .Net wrapper for the Google Tensorflow library. Allows Tensorflow functions to be called from .NET compatible languages such as C#, VB, VC++, IronPython.
https://www.emgu.com/wiki/index.php/Emgu_TF
Other
214 stars 43 forks source link

Unity 'person' recognition not working #36

Closed oakmusic closed 3 years ago

oakmusic commented 4 years ago

Just downloaded Emgu TF Lite 2.x from Unity Asset Store, and running the CocoSsdMobilenet example, I'm not able to detect "persons". Neither with pictures (as Textures) nor with live stream video from phone camera (Android build).

I tried with "coco_ssd_mobilenet_v1_1.0_quant_2018_06_29" and "ssd_mobilenet_v3_small_coco_2020_01_14", but it doesn't recognize persons. It works with "cats", "cars", "horses", ... and all those things, but not with "person". What am I doing wrong?

emgucv commented 4 years ago

Thanks for pointing that out. Fixed here d25d1496073f4a424047d387a261a07a129474f5 We will be pushing the new Emgu TF Lite v2.2 release out.

oakmusic commented 4 years ago

A possible solution for the Memory Leak: Insert Texture2D.Destroy() in NativeImageIO.Unity.cs file:

line 94:

        if (inputHeight > 0 || inputWidth > 0)
        {
            Texture2D small = Resize(texture, inputWidth, inputHeight);
            colors = small.GetPixels32();
            width = inputWidth;
            height = inputHeight;
            Texture2D.Destroy(small);   // insert this line will avoid crash on Android using live webcam
        }
emgucv commented 3 years ago

Closing ticket now that v2.2 and v2.4 releases are available. And the issue has been fixed in those releases.