Giter VIP home page Giter VIP logo

Comments (1)

glenn-jocher avatar glenn-jocher commented on May 27, 2024

@complete-dope hello! It looks like you need some help interpreting and post-processing the output from the YOLOv8-pose ONNX model in JavaScript.

The shape 1 x 56 x 8400 indicates a common format where:

  • 1: Represents the batch size.
  • 56: Is the number of channels. Each channel in this context likely represents a different component or attribute of the keypoints and their confidence values.
  • 8400: Stands for the flattened dimensions of output data for the keypoints, with each keypoint possibly having its own X, Y coordinates and a confidence score.

To process these outputs in JavaScript, you’ll typically want to reshape or decode them into a more interpretable format (like separate X, Y coordinates and confidence for each keypoint). Here's an example snippet that might help guide you:

const output = modelOutput.data;  // pseudo code, replace with actual ONNX model output retrieval 
const keypoints = [];
const numKeypoints = (8400 / 3);  // if each keypoint has x, y, and confidence

for(let i = 0; i < numKeypoints; i++) {
    const x = output[i * 3];
    const y = output[i * 3 + 1];
    const confidence = output[i * 3 + 2];
    keypoints.push({x, y, confidence});
}

// Now you can use the 'keypoints' array as needed

This code assumes that each set of 3 values in the flat 8400-length array corresponds to the x-coordinate, y-coordinate, and confidence level of a keypoint. Modify the above as necessary to match the specific structure of your output.

Happy coding! 😊 If you need further clarification, feel free to ask!

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.