Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda