Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
What is the right way to use this pose-detection library in javascript in the browser?

I'm sure I'm outing myself as a web development noob here, but I wasn't able to figure it out myself. I appreciate any help anyone can provide.

I'm trying to run a basic example using this pose-detection library. The readme states that I can include it either through regular script tags or a package manager. My goal is to build a very simple example without a build pipeline, so I've been running the following code by opening it in a browser, but without much success:

<!doctype html>
<html lang="en">

    <head>

    </head>

    <body>
        <script src="https://cdn.jsdelivr.net/npm/@mediapipe/pose"></script>
        <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/pose-detection"></script>
        <script>
         !async function () {
             const model = poseDetection.SupportedModels.BlazePose;
             const detectorConfig = {
                 runtime: 'mediapipe',
                 solutionPath: 'base/node_modules/@mediapipe/pose'
             };
             const detector = await poseDetection.createDetector(model, detectorConfig);
         }()
        </script>
    </body>

</html>

The resulting error message looks like so:

Uncaught (in promise) TypeError: t.Pose is not a constructor
    at new e (pose-detection:17)
    at pose-detection:17
    at pose-detection:17
    at Object.next (pose-detection:17)
    at pose-detection:17
    at new Promise (<anonymous>)
    at a (pose-detection:17)
    at g (pose-detection:17)
    at Object.<anonymous> (pose-detection:17)
    at pose-detection:17

I looked through the minified version of the library code that is served by the CDN and found the respective spot in the source code repository. It looks to me like the mediapipe dependency just doesn't get resolved correctly, and maybe that's because it's assumed to run through a package manager? Is my assumption that I should be able to run it the way I do just wrong or is something in how the library is distributed prohibiting it from being included through script tags like I'm doing there?

Thanks in advance. Please let me know if I've omitted any details that are important.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!