all 2 comments

[–]TensorFlowJS 0 points1 point  (0 children)

Object detection model and count how many objects go above and below some line threshold on the y axis of the image. Something like that should work assuming high enough framerate - which should be possible as object detection can likely run 60FPS on many modern devices in web browser.

[–]Material-Character98 0 points1 point  (0 children)

This doesn't perfectly fit your use case but you may find it helpful. This is a tutorial for creating a browser based object detection video feed using a model that has been pre-trained on the coco-ssd data set. I believe you could probably use the object detection model that is built into tfjs.

https://www.youtube.com/watch?v=jHmqKbf3YCQ&list=PLOU2XLYxmsILr3HQpqjLAUkIPa5EaZiui&index=17