tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.37k stars 1.92k forks source link

Is real time object detection possible using TensorCamera and Cocossd ? #4988

Closed AdarshJais closed 3 years ago

AdarshJais commented 3 years ago

When I use Tensor Camera

  1. It is very much laggy
  2. I guess it keeps capturing each frame and thus we just get one item in prediction using the mobilenet model
  3. In case we use cocossd for multiple image detection it throw error ""tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead""

So How is it possible to make a real-time multiple image detection, I can see an example in flutter so is that the same possible in React Native anyway?

Flutter example that I need in React Native : - https://heartbeat.fritz.ai/turning-the-mobile-camera-into-a-real-time-object-detector-with-flutter-and-tensorflow-lite-f412962b1805

RohitGamare commented 3 years ago

You can refer tensorflow js face landmark detection from the tensorflow website itself it might help you ,for capturing the images u can use openCV

rthadur commented 3 years ago

This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there.

google-ml-butler[bot] commented 3 years ago

Are you satisfied with the resolution of your issue? Yes No

uffoltzl commented 3 years ago

When I use Tensor Camera

1. It is very much laggy

2. I guess it keeps capturing each frame and thus we just get one item in prediction using the mobilenet model

3. In case we use cocossd for multiple image detection it throw error ""tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead""

So How is it possible to make a real-time multiple image detection, I can see an example in flutter so is that the same possible in React Native anyway?

Flutter example that I need in React Native : - https://heartbeat.fritz.ai/turning-the-mobile-camera-into-a-real-time-object-detector-with-flutter-and-tensorflow-lite-f412962b1805

Did you find a solution?

anhquan291 commented 2 years ago

Hi. I'm facing the same issue. It's very laggy on Android. Any helps please? Thanks a lot

AdarshJais commented 2 years ago

When I use Tensor Camera

1. It is very much laggy

2. I guess it keeps capturing each frame and thus we just get one item in prediction using the mobilenet model

3. In case we use cocossd for multiple image detection it throw error ""tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead""

So How is it possible to make a real-time multiple image detection, I can see an example in flutter so is that the same possible in React Native anyway? Flutter example that I need in React Native : - https://heartbeat.fritz.ai/turning-the-mobile-camera-into-a-real-time-object-detector-with-flutter-and-tensorflow-lite-f412962b1805

Did you find a solution?

No bro, no solution yet.

arpitKohli112 commented 1 year ago

Hi. I'm facing the same issue. It's very laggy on Android. Any helps please? Thanks a lot

Brother did you find any solution to this im also facing same problem im using a model that I created using teachable machine and its very laggy ?

arpitKohli112 commented 1 year ago

When I use Tensor Camera

1. It is very much laggy

2. I guess it keeps capturing each frame and thus we just get one item in prediction using the mobilenet model

3. In case we use cocossd for multiple image detection it throw error ""tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead""

So How is it possible to make a real-time multiple image detection, I can see an example in flutter so is that the same possible in React Native anyway? Flutter example that I need in React Native : - https://heartbeat.fritz.ai/turning-the-mobile-camera-into-a-real-time-object-detector-with-flutter-and-tensorflow-lite-f412962b1805

Did you find a solution?

Brother did you find any solution to this im also facing same problem im using a model that I created using teachable machine and its very laggy ?

arpitKohli112 commented 1 year ago

Hi. I'm facing the same issue. It's very laggy on Android. Any helps please? Thanks a lot

any solution brother pls help ?

uffoltzl commented 1 year ago

Hi. My solution is still a little bit laggy on android, but you can find an article I wrote about two years ago (https://www.bam.tech/article/how-to-recognize-real-time-object-in-reactnative-for-dummies) it has not been updated since so it may be an outdated solution. Hope it can help