MoveNet model Tensorflow

Hi guys, I have some question to ask about MoveNet model for detecting posture of humans. If I want to add coordinates more than 17 which MoveNet give it, how can I develop this.

Thanks for all answer.

Hi @Krittipong_Wachirang ,

I think Movenet is designed to output 17 keypoints by default. I am not sure which other movenet gives for additional keypoitns detetction. But Fine-tuning MoveNet on Custom Data, Extending the MoveNet Architecture, Combining MoveNet with another Movenet model for specifically trained to detect the additional keypoints you need. This would involve running both models in parallel and merging their outputs.

Thanks.

TensorFlow 2.16 + Python 3.12 – JARaaS Hybrid RAG - 6/16/2024

To enhance the MoveNet model to detect more than 17 key points, you would need to follow these steps:

  1. Collect a Dataset: Gather a dataset that includes the additional key points you want to detect. You may need to manually annotate a new dataset or find an existing one that meets your requirements.

  2. Modify the Model: Update the model architecture to output the new number of key points. This typically involves adjusting the final layer to match the required number of outputs.

  3. Prepare the Data: Normalize your images and annotations to fit the model requirements. Convert your annotations into the format required for training.

  4. Train the Model: Use TensorFlow or another deep learning framework to train the model with the custom dataset. Make sure to fine-tune hyperparameters and assess the model’s performance throughout the process.

Here’s a simple example using TensorFlow to modify a model:

import tensorflow as tf
from tensorflow.keras import layers, models

# Define the modified architecture
def create_model():
    base_model = tf.keras.applications.MobileNetV2(input_shape=(224, 224, 3), include_top=False)
    model = models.Sequential([
        base_model,
        layers.GlobalAveragePooling2D(),
        layers.Dense(34, activation='linear')  # Adjust output size for 34 key points
    ])
    return model

model = create_model()

# Compile the model
model.compile(optimizer='adam', loss='mean_squared_error')

# Train the model with your dataset
# Replace `train_images`, `train_keypoints` with your training data
model.fit(train_images, train_keypoints, epochs=10, batch_size=32)

References:

  • Object-Oriented Modeling in TensorFlow: migrating_checkpoints.ipynb (internal document)
  • High-Level Keras API: keras.md (internal document)

I hope this helps in extending the MoveNet model for your requirements! If you need further assistance or more detailed steps, feel free to ask.

1 Like