# Video classification with MoViNet in web browser?

**URL:** <https://discuss.ai.google.dev/t/video-classification-with-movinet-in-web-browser/16256>\
**Category:** General Discussion\
**Tags:** tfjs, help\_request\
**Created:** [May 18, 2023, 9:17am UTC](https://discuss.ai.google.dev/t/video-classification-with-movinet-in-web-browser/16256 "2023-05-18T09:17:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TsuNa](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@TsuNa](https://discuss.ai.google.dev/u/TsuNa)\
**Post date:** [May 18, 2023, 9:17am UTC](https://discuss.ai.google.dev/t/video-classification-with-movinet-in-web-browser/16256/1 "2023-05-18T09:17:57Z")

</div>

Hey there !  
I’m here to get some advice about a video classification problem, but with a constraint : I’ve to do this in a web browser. Here is the context :  
I’ve to create an app to identify a composed move (with 3 distinct sub moves). So I thought to train a CNN to recognize these 3 sub moves ([with MoviNet](https://www.tensorflow.org/lite/examples/video_classification/overview)), then to decide if this is the expected composed move. However, I’ve an imposed constraint : The app should works in a web browser, so i’ts excluding using Python. Moreover it should run only on client side. Server is here only to answer the request for html/css/js (dunno why, it’s an imposed constraint.) So I’m limited to JS and TF.js.  
Unfortunately, when I click on the page I linked earlier to [download the starter video classification model](https://tfhub.dev/tensorflow/movinet/a0/stream/kinetics-600/classification/3), it seems I can only download models for TF or TFLite, which are using Python, nothing for TF.js.  
Is there a way I can use a MoViNet model in a web browser environment ? May I can train the MoViNet model for my task in a python environment then convert it using [tfjs-converter](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter) ? Or is this precise model to complex for a web browser ? May even the task requires too much ressources for a web browser ?

Thanks for help

---

<div class="post-metadata">

**Author:** ![Jason](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/jason/32/6193_2.png) [@Jason](https://discuss.ai.google.dev/u/Jason)\
**Post date:** [May 26, 2023, 4:59pm UTC](https://discuss.ai.google.dev/t/video-classification-with-movinet-in-web-browser/16256/3 "2023-05-26T16:59:20Z")

</div>

You may want to use the output of a model like MoveNet:

> **[Next-Generation Pose Detection with MoveNet and TensorFlow.js](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html)**
>
> MoveNet is a human pose detection architecture developed at Google that is ultra fast and accurate. It was designed to detect difficult poses

To then record these points over many frames of video, and then use those inputs as your training data - eg maybe you have a couple of seconds of data (or whatever time frame is needed to perform the moves), to which you use some classification network on that data depending on how you encode it such as a multi layer perceptron, LSTM, or even a CNN I have seen people use if you represent the captured data as an image:

> **[\- YouTube](https://t.co/yFQszvVYoT)**
>
> Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

---

<div class="post-metadata">

**Author:** ![Siam](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/siam/32/39030_2.png) [@Siam](https://discuss.ai.google.dev/u/Siam)\
**Post date:** [January 24, 2025, 5:03am UTC](https://discuss.ai.google.dev/t/video-classification-with-movinet-in-web-browser/16256/5 "2025-01-24T05:03:19Z")

</div>

![Screenshot 2025-01-24 044812](https://d3qe71uytubmmx.cloudfront.net/original/3X/c/4/c4558c54bd71e96a3fb454c1108306e6c1076a0d.png)

**Subject: Issue with Optimizer in `model.compile`: “Could not interpret optimizer identifier”**

Hi TensorFlow Team,

I’m encountering an error while using the MoViNet model code provided in the TensorFlow repository (used as-is, without any modifications). The error occurs when compiling the model with the `Adam` optimizer:  
`ValueError: Could not interpret optimizer identifier: <keras.src.optimizers.adam.Adam object at 0x...>`.

Here’s what I’ve already tried to resolve the issue:

1. Verified that TensorFlow and Keras are correctly installed and compatible (TensorFlow version: 2.18.0, Keras version: 3.8.0).
2. Tried both `from tensorflow.keras.optimizers import Adam` and `from keras.optimizers import Adam`.
3. Checked for multiple Keras installations and reinstalled both TensorFlow and Keras.
4. Ensured the correct optimizer object is passed during `model.compile`.

Despite these efforts, the issue persists. Below is the link to the MoViNet code I am using:

> **[Transfer learning for video classification with MoViNet  | ...](https://www.tensorflow.org/tutorials/video/transfer_learning_with_movinet)**

Could this be related to a version incompatibility or an internal conflict between TensorFlow and Keras? Any insights or recommendations would be greatly appreciated.

Thanks!
