Skip to content

Commit

Permalink
bump mediapipe version
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed May 23, 2024
1 parent 89ded3a commit 548922d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Demo: https://eyaler.github.io/LordTubeMaster/

Note as of April 2024 this is only supported on *Chromium desktop*
Note as of May 2024 this is only supported on *Chromium desktop*

For fullscreen zoom of output (by right-click), enable: `chrome://flags/#element-capture`

Expand Down
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PoseLandmarker,
FilesetResolver,
DrawingUtils
} from 'https://cdn.jsdelivr.net/npm/@mediapipe/[email protected].12/vision_bundle.mjs'
} from 'https://cdn.jsdelivr.net/npm/@mediapipe/[email protected].14/vision_bundle.mjs'

video_url.addEventListener('change', e => get_video(e.currentTarget))
video_url.addEventListener('keydown', e => {if (e.key == 'Enter' || e.key == 'Tab') get_video(e.currentTarget)})
Expand Down Expand Up @@ -218,7 +218,7 @@ async function capture() {
}
}

const vision = await FilesetResolver.forVisionTasks('https://cdn.jsdelivr.net/npm/@mediapipe/[email protected].12/wasm')
const vision = await FilesetResolver.forVisionTasks('https://cdn.jsdelivr.net/npm/@mediapipe/[email protected].14/wasm')
const poseLandmarker = await PoseLandmarker.createFromOptions(
vision,
{
Expand All @@ -239,11 +239,11 @@ async function capture() {
async transform(videoFrame, controller) {
const W = videoFrame.codedWidth
const H = videoFrame.codedHeight
let rgba = new Uint8ClampedArray(W * H * 4)
if (effect.value.includes('landmarks'))
effect_funcs['pose_landmarks'](W, H, videoFrame, poseLandmarker, canvasCtx, drawingUtils)
else
canvasCtx.clearRect(0, 0, W, H)
let rgba = new Uint8ClampedArray(W * H * 4)
if (effect.value == 'pose_landmarks')
rgba = rgba.map((_, i) => ((i+1) % 4 == 0) * 255)
else {
Expand Down

0 comments on commit 548922d

Please sign in to comment.