'Use PoseNet model with MoveNet Tensorflow.js

I currently have a trained model using google's teachable machine, found here: https://teachablemachine.withgoogle.com/train

Google's teachable machine uses PoseNet to train the model, but I was curious if there was a way to use this trained model with MoveNet instead, found here: https://github.com/tensorflow/tfjs-models/tree/master/pose-detection/src/movenet

From what I can tell, both MoveNet and PoseNet are tracking the same body points - MoveNet just does it better.

My current model, set up with PoseNet, looks something like this (URL being the trained model):

 const URL = "https://teachablemachine.withgoogle.com/models/grvO4iYXr/";
 let model;
  
 async function init() {
          const modelURL = URL + "model.json";
          const metadataURL = URL + "metadata.json";
  
          // load the model and metadata
          // Note: the pose library adds a tmPose object to your window (window.tmPose)
          model = await tmPose.load(modelURL, metadataURL);
          maxPredictions = model.getTotalClasses();
   }

Move net seems to set up models like so:


const detectorConfig = {modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING};
let detector;
  
 async function init() {
      const detector = await poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig);
   }

I'd like to use my PoseNet model with MoveNet if possible. Any help/advice is appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source