I attempted to use the Movnet model with tflite_flutter. The code is mostly based on the example code on ttps://github.com/am15h/object_detection_flutter, with a few minor changes.
It seems like there is a memory leak if i run the interpreter with metal delegate, the inference time is pretty good but the memory increase linearly and eventually the app crashes.
I created the interpreter outside of the isolate and also used Interpreter.fromFile instead of interpreter.fromAsset as i thought it was the issue but apparently it was not.
I attempted to use the Movnet model with tflite_flutter. The code is mostly based on the example code on ttps://github.com/am15h/object_detection_flutter, with a few minor changes.
It seems like there is a memory leak if i run the interpreter with metal delegate, the inference time is pretty good but the memory increase linearly and eventually the app crashes.
I created the interpreter outside of the isolate and also used Interpreter.fromFile instead of interpreter.fromAsset as i thought it was the issue but apparently it was not.
Here are some screenshots:
With the metal delegate:![image](https://user-images.githubusercontent.com/72212398/218766569-02253c89-1857-4561-9940-bb31d2615859.png)
Without the metal delegate:![image](https://user-images.githubusercontent.com/72212398/218766719-073c7720-73e3-4be7-8c86-bb5ee7867b8f.png)
The code can be seen on my public repository (https://github.com/JunHeyy/TFlite_Flutter_MovNet.git)
Any help would be appreciated :) Thank you for reading.