Code Monkey home page Code Monkey logo

emgutf's Introduction

Emgu TF

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.

This repository contains two projects:

  1. Emgu TF that can load and run full tensorflow models on Windows, Mac OS, Linux and Android.
  2. Emgu TF Lite that can load and run tensorflow lite models on Windows, Mac Os, Linux, Android and iOS. It is recommended to use Emgu TF Lite on mobile devices.

Please visit our project page for more detail: http://www.emgu.com/wiki/index.php/Emgu_TF

emgutf's People

Contributors

canmingh avatar emgucv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emgutf's Issues

MultiboxGraph Detect is not working

I was trying to test MultiboxGraph

var graph = new MultiboxGraph();               

Tensor imageTensor = ImageIO.ReadTensorFromImageFile(source, 224, 224, 128.0f, 1.0f / 128.0f);

var watch = Stopwatch.StartNew(); 
var result = graph.Detect(imageTensor); //Here I have an error Out of range Exception
watch.Stop();

It downloaded .pb file and some location_prirors.txt. These are demo files I suppose. I have no idea what the second file is, but it doesn't work anyway, becouse of out of range exception. Im using the latest Nuget version of Emgu.TF and Emgu.TF.Models.

I have some trained .pb files with my own classes on faster_rcnn_Inception_V2 pretrained model and I want to use it with MultiboxGraph. Is this model architecutre compatible? I think it should be becouse of version of tensorflow on which it was trained from scratch.

Im guessing that it is gonna be somethong like this:


var graph = new MultiboxGraph(null, new string[] {
   "frozen_inference_graph.pb",   
   "ihavenoideawhatkindoffileisthat.txt"});

The second file... I have no idea what kind of informations this file contains and how can I generate one for my .pb file.

I also need to get bounding boxes locations, confidence levels and class names. Is it something like that?

var bb = result.DecodedLocations;
var classes = result.Indices;
var scores = result.Scores;

About that out of range error, is it Nuget Emgu.TF.Models version problem or am I did something wrong?

Cuda version mismatch.

Ok, after updating my nVidia drivers, with the related issue I reported in #40, I got yet another problem:

When running an inference, I got this exception:

Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.

Now, I looked for this error and github and Tensorflow forums are full of reports like this, pointing that it's a problem with Cuda drivers.

It seems that Emgu.TF deploys cudnn64_7.dll 10.1.105 , and my nVidia drivers come with NVCuda64.DLL 11.0.208

Now, most issues I've read around state that the solution is to downgrade the drivers to Cuda 10.2.... for which you need to install Cuda Toolkit 10.2 ... which is a 2GB download. This might be acceptable for a developer, but not for an end user.

Also, I've tried to look for older versions of the cuda runtime at nVidia site, and everything points to the toolkits, so it seems the runtimes are tied to the nVidia main drivers.... so there's no way to install a specific cuda driver other than with the toolkit.

It also surprises me that the Cuda drivers are not backwards compatible (as in DirectX or OpenGL), which means that Cuda is essentially unusable for any use other than proffesional use cases.

AccessViolationException in Mat

If we create a new instance of a Mat by using the .Col(column) or .Row(row) method or define to use exiting data for a new Mat, the parameter “needDispose” in the underlying internal constructor is always set to “true”. This means that if we try to share data between different instances of Mats, the data will get disposed as soon as one Mat object gets disposed. This results in an AccessViolationException when trying to access the data through some of the other Mat instances.

Can CUDA version fall back to CPU when no GPU is installed?

We have built our app with CUDA EMGU TF support, and it works great--but only on machines with an NVidia GPU installed. If there is no NVidia GPU, it gives an error reporting "nvcuda.dll" cannot be found. Is there anything you can do to ensure that the app will run even on systems that have no GPU at all?

Please distribute ProtoBuf generated classes

Distribute the protobuf generated configuration classes needed to specify options, such as GPUOptions, GraphOptions, OptimizerOptions, ConfigProto and so on. It seems we need to generate these classes ourselves in order to use them.

Can't import any model using ImportGraphDef

Tried the following:

  1. Train model (python) on Keras (TF 2.2) and saving the model as h5 - can't import [Exception: 'InvalidGraphDef']
  2. Freeze the above model and migrate to .pb file (similar to what we've done @ tf 1.15) - can't import [Exception: 'Input 1 of node bn_Conv1/cond was passed float from bn_Conv1/gamma:0 incompatible with expected resource.']
  3. Train model (python) on Keras (TF 2.2) and saving the model as pb ('savedmodel' format) - can't import [Exception: 'InvalidGraphDef']

Is there's another way to import models?

TFLite UNITY - CocoSsdMobilenet

Is there a new version of TFLite for Unity?
I am trying to implement the CocoSsdMobilenet example on Unity but I am getting errors:

  • The type or namespace name 'Annotation' could not be found (are you missing a using directive or an assembly reference?)
    -'NativeImageIO' does not contain a definition for 'DrawRect'
  • No overload for method 'Recognize' takes 4 arguments

How to convert from Mat to Tensor and vice versa

So i want to make a prediction with my tflite model. For input i use NativeImageIO.ReadImageFileToTensor but when i tried to convert it back to Mat but the image is broken


What is shown

Original image

Any ideas ?

Exception on Inception Recognise

I'm generating a tensor from a Mat, using

var t = ReadTensorFromMatBgr(frame, DataType.Float)
var r = inception.Recognize(t);

I get

System.Exception: 'Input to reshape is a tensor with 8064 values, but the requested shape requires a multiple of 2048
[[{{node head0_bottleneck/reshape}}]]'

Can not distinguish colors

When I compared picture has 1 color with other picture has 1 color different (black and white or blue and yellow) with accuracy of about 95%, it will return true. Is it a bug or is there a way to fix it?
Thanks for reading.

Unity 'person' recognition not working

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?

Myriad X / Compute sticks support.

We're leveraging Emgu on low end machines, and we were thinking about the possibility of boosting these machines with compute sticks.

So, we would like to know if Emgu.TF supports these compute sticks, or if there's plans to support them in the future.

EMGU TF lite Android

When I launch the application on the android, I get the error "DllNotFoundException: tfliteextern"
Where can I download this library?

Not working for IL2CPP for Android build

Unity version: 2019.1.12 or 2019.2.2 or 2019.3.0
Emgu.TF.Lite plugin version: 1.15

When I use the Unity Emgu TF Lite plugin and try to build for Android using the IL2CPP scripting backend and try to create the FlatBufferModel you get an exception:
Unsupported internal call for IL2CPP:Assembly::GetManifestModuleInternal - "This icall is not supported by il2cpp"

I need to build using IL2CPP because the play store only accepts 64 bit builds, and you can only build arm64 if you run IL2CPP scripting backing.

The problem can be recreated by starting a new project, importing the Emgu.TF.Lite 1.15 plugin from the asset store, switch the build to android and selecting the scripting backend to IL2CPP and running the demo project CocoSsdMobilenet from the plugin on an android device. (I used a Google Pixel 3). The project works perfectly with the "Mono" scripting backend. but then I can't build to arm64.

Any help would be greatly appreciated

Build the binary in CentOS Error

when i build Emgu CV by calling make command in CentOS 7, the compile was failed, there is an error like this:
[ 95%] Building CXX object Emgu.CV.Extern/CMakeFiles/cvextern.dir/vector_ERStat.cpp.o In file included from /usr/local/src/emgucv/opencv/modules/core/include/opencv2/core.hpp:56:0, from /usr/local/src/emgucv/opencv/modules/core/include/opencv2/core/types_c.h:124, from /usr/local/src/emgucv/opencv/modules/core/include/opencv2/core/core_c.h:48, from /usr/local/src/emgucv/Emgu.CV.Extern/vectors_c.h:12, from /usr/local/src/emgucv/Emgu.CV.Extern/vector_ERStat.h:15, from /usr/local/src/emgucv/Emgu.CV.Extern/vector_ERStat.cpp:10: /usr/local/src/emgucv/opencv/modules/core/include/opencv2/core/traits.hpp: In instantiation of ‘struct cv::traits::Type<cv::text::ERStat>’: /usr/local/src/emgucv/opencv/modules/core/include/opencv2/core/mat.inl.hpp:95:32: required from ‘cv::_InputArray::_InputArray(const std::vector<_RealType>&) [with _Tp = cv::text::ERStat]’ /usr/local/src/emgucv/Emgu.CV.Extern/vector_ERStat.cpp:77:35: required from here /usr/local/src/emgucv/opencv/modules/core/include/opencv2/core/traits.hpp:386:8: 错误:‘type’不是‘cv::DataType<cv::text::ERStat>’的成员 { enum { value = DataType<T>::type }; }; ^ make[2]: *** [Emgu.CV.Extern/CMakeFiles/cvextern.dir/vector_ERStat.cpp.o] 错误 1 make[1]: *** [Emgu.CV.Extern/CMakeFiles/cvextern.dir/all] 错误 2 make: *** [all] 错误 2
I need a help or guide!!

Emgu TF Lite v1.14.unitypackage Missing

Hi,

Our Model is trained in TensorFlow version 1.14, as per the EMGU TF docs, Emgu.TF-1.14.0 supports TensorFlow 1.14 but the unity plugin is only available for 1.15 and 1.13. How to download the unity plugin for 1.14.

GetAllocator() is not implemented

I am using EmguTF 1.7.0.174 for a neural network trained with Python with Tensorflow 1.7. I froze the neural network and then load that with Emgu. The implementation worked on my PC, but my application gives this error on another PC where I installed it:
C:\bb\tf_x64\build\tensorflow\tensorflow/core/framework/device_base.h:168] GetAllocator() is not implemented.
The second PC does not have Tensorflow installed and also does not have a GPU. But since I use the free license, which doesn't have GPU support, I don't think that will be the problem.
It also only does it after the application has been running for a while. So it is able to load the neural network and apply it successfully a few times and then it crashes with that error.
What can be the cause of this?

inavlid graph def..

When trying to use a retrained model to recognize throwing an error 'invalid graph def'

Inception inceptionGraph = new Inception(null, new string[] {"optimized_graph.pb", "output_labels.txt"},
                "https://github.com/emgucv/models/raw/master/inception_flower_retrain/");
            Tensor imageTensor = ImageIO.ReadTensorFromImageFile(fileName, 299, 299, 128.0f, 1.0f / 128.0f);

Commercial release 2.1 NuGet package gives build error

When I install the Emgu.TF.runtime.windows.cuda-CR.2.1.0.838.nupkg package, I get the following build error:
emgu.tf.runtime.windows.cuda.dnn\7.4.2\build\Emgu.TF.runtime.windows.cuda.dnn.targets(21,5): error : 'X86 or AnyCPU is targeted, but this DNN package do not support 32-bit'

I do not get these build errors from EmguCV or if I reference the DLL files directly. My application is a 64-bit app. While I normally configure the build as "AnyCpu", I set "Prefer 32-bit" to false. Even if I configure the app as 64-bit, I get this error.

"Exception unhandled: InvalidGraphDef ".Error when trying inception demo with own trained model

Hi emguTF community,

I used the retrain.py script to retrain the inception v3 model for the flowers classification demo and I got 2 files: trained_graph.pb and trained_labels.txt. Using freeze.py, I can export the frozen model. When I used the retrain_model_classifier.py, the classification is correct using my exported model and the frozen model thus I am sure my pb and txt files are good.

Then, I tried to get the classification result using the Inception demo and I got the error "Exception unhandled: InvalidGraphDef " calling the function Emgu.TF.Graph.ImportGraphDef(Buffer graphDef, ImportGraphDefOptions options, Status status)

I tried with a simple demo like this in python:
a = tf.placeholder(tf.int32, name="input_a")
b = tf.placeholder(tf.int32, name="input_b")
mul = tf.multiply(a, b,name="op_Mul")
then get the frozen graph and the function does not show error. Why using the same code lines, I get error using my trained inception model? What is the meaning of this error? Any suggestion about how to export correctly the models?

tfextern.dll missing

When building Multiboxdetection project (windows Desktop), I got this error:
'This package do not contain necessary binary for WindowsForms. X64 is targeted, but file C:\emgutf-master\emgutf-master\Emgu.TF..\lib\x64\tfextern.dll is missing.' MultiboxPeopleDetection C:\emgutf-master\emgutf-master\Emgu.TF\Emgu.TF.projitems 217

Exception creating TF Session with CUDA: "CUDA driver version is insufficient for CUDA runtime version"

When I try to create a TF Session with CUDA, I get this error:

"CUDA driver version is insufficient for CUDA runtime version"

Now, obviously the solution is to update my drivers... but that's not the problem.

The problem is that both Emgu.CV.Cuda.CudaInvoke.HasCuda and TF.TfInvoke.IsGoogleCudaEnabled return TRUE

Now this is the problem: if we're to deliver a software in the wild, we have to ensure the client's machine has the right hardware and software, which means we need a way to detect it has the right cuda drivers, among other things.

The application workflow should go like this:

  1. Do we have the hardware and drivers ready?
    • NO: Report to the user what's missing and EXIT.
    • YES: Continue
  2. Create TF.Session
  3. Start VideoCapture
  4. Loop

Trusting IsGoogleCudaEnabled in step (1) is clearly useless because it will let the application continue running until step (4) at which point it will throw an exception and crash the application.

So we need to know before creating a Session that we absolutely meed all the hardware and driver requirements, I would suggest something like this:

enum CudaStatus
{
    Ready, DriversNotFound, DriversInsufficientVersion , FatalError, AnyOtherUsefulErrorThatCanHintTheEndUserHowToFixProblem
}

CudaStatus TF.TfInvoke.GetGoogleCudaStatus();

Finally, I decided to update my nVidia drivers, which come with Cuda 11, and it seems it's the next big iteration, and tensorflow needs Cuda 10.2 .... so tensorflow is throwing exceptions when running inferences.

inceptionGraph.Recognize(imageTensor) error!

I dont understand this issue, because the example is good.

float[] probability = inceptionGraph.Recognize(imageTensor);

Object reference not set to an instance of an object.
Uncontrolled exception of type 'System.NullReferenceException' in Emgu.TF.Models.dll

Someone that help me!

Looking for equivalent to cvFindExtrinsicCameraParams2

I have some code that is working with the v2.1.0 version of the library and I need to upgrade to the current. However a lot of the methods I was previously using don't seem to exist anymore.

How can I find the equivalent to these methods in order to formulate the same result?

   `//Local Variable Declaration
    var worldPoints = CvInvoke.cvCreateMat(3, 4, DepthType.Cv64F);
    var imagePoints = CvInvoke.cvCreateMat(2, 4, DepthType.Cv64F);
    var translation = CvInvoke.cvCreateMat(3, 1, DepthType.Cv64F);
    var rodrigues = CvInvoke.cvCreateMat(3, 1, DepthType.Cv64F);
    var rotationMat = CvInvoke.cvCreateMat(3, 3, DepthType.Cv64F);
    var intrinsic = CvInvoke.cvCreateMat(3, 3, DepthType.Cv64F);
    var distortion = CvInvoke.cvCreateMat(1, 4, DepthType.Cv64F);
    var x = default(double);
    var y = default(double);

    for (int r = 0; r < 3; r++)
    {
        for (int k = 0; k < 4; k++)
        {
            CvInvoke.cvSetReal2D(worldPoints, r, k, this.PointMap2[k].ECEF[r]);
        }
    }

    for (int k = 0; k < 4; k++)
    {
        x = (this.PointMap2[k].Point[0] - 0.5) * this.Width;
        y = (this.PointMap2[k].Point[1] - 0.5) * this.Height;

        CvInvoke.cvSetReal2D(imagePoints, 0, k, x);
        CvInvoke.cvSetReal2D(imagePoints, 1, k, y);
    }

    for (int r = 0; r < 3; r++)
    {
        for (int c = 0; c < 3; c++)
        {
            CvInvoke.cvSetReal2D(intrinsic, r, c, this.Coeffs[r, c]);
        }
    }

   CvInvoke.cvZero(rodrigues);
   CvInvoke.cvZero(translation);
   CvInvoke.cvZero(distortion);

   CvInvoke.cvFindExtrinsicCameraParams2(worldPoints, imagePoints, intrinsic, 
   distortion, rodrigues, translation);
   CvInvoke.cvRodrigues2(rodrigues, rotationMat);`

When i use the Dlls for building Unity application, it is throwing errors

I'm getting the following errors

Assets/Emgu.TF/Scripts/Inception.cs(32,38): error CS1061: Type Emgu.Models.FileDownloadManager' does not contain a definition for CurrentWebClient' and no extension method CurrentWebClient' of type Emgu.Models.FileDownloadManager' could be found. Are you missing an assembly reference?

Assets/Emgu.TF/Scripts/Inception.cs(97,43): error CS0029: Cannot implicitly convert type void' to object'

Please advice

Attempting to JIT compile method '(wrapper native-to-managed) int Emgu.TF.Lite.TfLiteInvoke:TfliteErrorHandler (int,intptr)' while running in aot-only mode.

We've purchased the commercial version of Emgu.TF but are receiving errors whilst running the unmodified Lite iOS example solution on real iOS devices. This works in the simulator, but not on real iOS devices.

Library: libemgutflite-pro-2.4.0.1059

Solution: Emgu.TF.Lite.Example.iOS.sln (unmodified, Xamarin Forms)

IDE: Visual Studio for Mac 8.8.3 (build 16) with Mono 6.12.0.107

Configuration: Debug | iPhone (iPhone 11 Max on iOS 14.3)

Error: Attempting to JIT compile method '(wrapper native-to-managed) int Emgu.TF.Lite.TfLiteInvoke:TfliteErrorHandler (int,intptr)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

StackTrace: _at (wrapper managed-to-native) System.Object._icall_wrapper_mono_delegate_to_ftnptr(object)
at (wrapper managed-to-native) Emgu.TF.Lite.TfLiteInvoke.RedirectError(Emgu.TF.Lite.TfLiteInvoke/TfliteErrorCallback)
at Emgu.TF.Lite.TfLiteInvoke..cctor () [0x00088] in /libemgutflite-pro/Emgu.TF.Lite/TFLiteInvoke.cs:294

Screen Shot 2020-12-09 at 3 31 52 pm

Are you aware of this issue? Or have any suggestions to resolve? Further to this, Release | iPhone build breaks throwing ~50 other errors.

UWP support.

Is Emgu.TF supported on Universal Windows Platform?

Loading x86/x64 native DLLs briefly change Environment.CurrentDirectory which leads to RANDOM CRASHES

I am using Emgu.TF in a complex project, where Emgu components are initialized and used in their own thread. Meanwhile, the main thread runs its own logic, which includes loading lots of files.

When Emgu loads its native DLLs, it briefly sets Environment.CurrentDirectory to point to the x86 or x64 path where the native DLLs are located.

When that happens, and at the same time another thread is also loading files, the CurrentDirectory change will mess the paths for all threads and will cause FileNotFound exceptions.

Furthermore, if another thread that is loading files, happens to change CurrentDirectory, it will break the process of loading TF native DLLs with a similar crash.

The offending methods are:

I haven't checked Emgu.CV, but maybe it's also affected.

This is IMHO a very bad design, because it changes a process wide property in a non blocking way... essentially making the use of multithreading dangerous and crash prone.

Alternatives:

Refrain from using System.Environment.CurrentDirectory and instead, use these APIs:

These methods can be P/Invoked from c# to set additional Native LoadLibrary paths, so before loading the native libraries, you call AddDllDirectory, and when finished, you can call RemoveDllDirectory, or just leave it that way to ensure further LoadLibrary calls will also search in that directory.

This has the advantage that it doesn't change the application's current directory.

Btw, I've used these APIs in the past, they're the real deal for loading natives from multiple paths, because they don't affect in any way the loading paths of managed libraries.

NuGet Package not up to date

The latest NuGet package of Emgu.TF has version 1.2.0.26.
The latest release available on SourceForge is 1.4.0.

Also the namespaces available in the NuGet package are Emgu.TF, Emgu.Util and Emgu.TF.Util.TypeEnum. Everything else is missing.

Can you please sync the two release flows and update the NuGet package to the same thing as I can download on SourceForge?

"index out of bound exception" while reading the width and height from the input tensor

Hi, I am trying to integrate the custom quantized Mobilenet SSD v2 model to unity. I am getting an "index out of bound exception" while reading the width and height from the input tensor using the following command.
int height = CocoSsdMobilenet._inputTensor.Dims[1];

I checked my model and it appears to be fine. Below is the screenshot of it.

TFLite

if I am commenting these lines and initializing height and width as 300, on clicking on the play button unity engine is crashing with giving any exception. Please suggest.

Our quantized TFLite model works well in the sample project provided in Android Studio by TensorFlow but its giving exception here.

TF Lite: Encountered unresolved custom op: ´`{..

Tested with Emgu.TF.Lite 2.4.0.1059. Loading segm_full_v491.zip in a .NET 3.1 Core WPF app with new Interpreter(new FlatBufferModel("segm_lite_v509.tflite")).AllocateTensors(); results in the following exception, with varying random characters for the custom op:

Encountered unresolved custom op: ´�`{.�.
   at Emgu.TF.Lite.TfLiteInvoke.TfliteErrorHandler(Int32 status, IntPtr errMsg)
   at Emgu.TF.Lite.TfLiteInvoke.tfeInterpreterAllocateTensors(IntPtr interpreter)
   at Emgu.TF.Lite.Interpreter.AllocateTensors()

(Btw: Thanks for the great work!)

Custom Resolver

How do you create a Custom Operator to feed into the Interpreter constructor? Currently when loading a tflite model get the error as below:

Didn't find custom op for name...

GPU not used on commercial version

I have purchased the commercial version, but my model is still using CPU, although my PC supports CUDA (I can use GPU with Tensoflow in python)

Is there anything I must do to enable GPU?

How can I be sure the dlls I got are the GPU-enabled ones?

how can i detected the webcam is working?

Hi,
public static Capture CamCapture;
public static Mat Frame;
private void Form1_Load(object sender, EventArgs e)
{
CvInvoke.UseOpenCL = false;
CamCapture = new Capture();
CamCapture.ImageGrabbed += CamCapture_ImageGrabbed;
CamCapture.Start();
}

private void CamCapture_ImageGrabbed(object sender, System.EventArgs e)
{
Frame = new Mat();
var value= CamCapture.Retrieve(Frame);
camImg.Image = Frame;
}
how can i detected the webcam is working?
I can not found any properties or method to judge that is working.
the CamCapture.Retrieve(Frame) always is return true when the webcam line is pulled out.

Emgu TF Lite behavior changes for different devices

Hello, We are developing a Computer Vision-based cross-platform application in Unity. We are using Emgu TF Lite v14.unitypackage to Integrate integrate our TFLite model to Unity. We have noticed that the same model takes different time to process each frame when tested using Emgu(Unity) in the android and sample Android Studio project provided with Tensorflow. The application developed using Android Studio takes around half the time to process each frame compared to the Emgu TF Lite plugin in Android. The processing time for each frame is around 40-45 millisecond for iOS(tested on 3 devices iPhone XS Max, iPhone 7, and iPad 6th generation ) when using multithreading. Whereas processing time for each frame is around 200+ ms in Pixel 3, 500+ ms in Samsung S7 and on lower devices it's, even more, worst(That too after multi-threading).

  1. Can you please look into the performance of the TF-Lite plugin in android. It works well in iOS but not in Android.
  2. Can you please provide a multi-thread version for MobileNet and MobileNet COCO SSD example scene?
  3. Can you please provide a list of devices that supports your Plugin and how much FPS are you able to achieve in each of these devices when using multi-threading.

System Exception: 'No OpKernel was registered to support Op 'QuantizeV2' with these attrs.

Dear developers and community,

I know that the tutorial section for emgutf is under construction but I have been testing by myself your example codes. The inception and multibox models are working fine and the examples are easy to follow. However, when I tried the Stylize model, an error is displayed:
System.Exception: 'No OpKernel was registered to support Op 'QuantizeV2' with these attrs.
My demo code is as below:
StylizeGraph graph = new StylizeGraph();
Tensor imageTensor = ImageIO.ReadTensorFromImageFile(fileName, 224, 224, 128.0f, 1.0f / 128.0f);
Tensor result = graph.Stylize(imageTensor, 2);
byte[] imgData = ImageIO.EncodeJpeg(result, 1, 0);
Bitmap bmp;
using (var ms = new MemoryStream(imgData))
{
bmp = new Bitmap(ms);
resultPictureBox.Image = bmp;
}
So my question is:
Does the style variable (value is 2) incorrect? I didnt know what to type there so I tested any random number.
Does the input tensor "imageTensor" incorrectly defined?
EmguTF stylize model is not working yet?

I am newbie on tensorFlow and this is my first time posting in github so sorry in advance if the Issue section is not a forum to ask for problems related to codes. Also, I would like to know if we already can retrain the inception final layers (transfer learning) using emguTF.

MultiboxPeopleDetection

Hi,
I am emgu official user, and currently try to train own model used for MultiboxPeopleDetection
but really confused how to train my own model used in as MultiboxPeopleDetection.
Thanks

Custom MobileNetSSD V2 Float not working in EMGU

Hello Team,

I trained a Custom MobileNetSSD V2 Float model for hand pose detection, it's working Android Studio Sample project provided by TensorFlow (I changed the predefined model with my custom model) but when I am trying to run it using the EMGU TF lite model it's giving us no result. Attached is the python code for running. Attached is the sample image. I think Using EMGU TFLite it is reading wrong input tensor. Feel free to ask out if any info is required from my side.

Image_2019100115500541590009_1

Custom_Model.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.