Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
mediapipe-pose-smooth
Advanced tools
Readme
This library removes the jitter and smooth the landmarks coming from Mediapipe.
The library creates the average of every 8 frames to smooth the landmarks. The library is initialized with the first landmark received and then wait for the 8 more frames to start creating the average, meanwhile it returns the landmarks as it is. After the 8 frames, the library drops the 2 frames with the max values and 2 with the min values and starts to create the average from the remaining 4 frames and returns the average.
Install mediapipe-pose-smooth with npm/yarn
npm install mediapipe-pose-smooth // npm
yarn add mediapipe-pose-smooth // yarn
import smoothLandmarks from 'mediapipe-pose-smooth'; // ES6
const smoothLandmarks = require('mediapipe-pose-smooth'); // CommonJS
{
poseLandmarks: [
{ x: 1, y: 1, z: 1, visibility: 1 },
{ x: 2, y: 2, z: 2, visibility: 1 },
{ x: 3, y: 3, z: 3, visibility: 1 },
{ x: 4, y: 4, z: 4, visibility: 1 },
{ x: 5, y: 5, z: 5, visibility: 1 },
{ x: 6, y: 6, z: 6, visibility: 1 },
{ x: 7, y: 7, z: 7, visibility: 1 },
{ x: 8, y: 8, z: 8, visibility: 1 },
{ x: 9, y: 9, z: 9, visibility: 1 },
{ x: 10, y: 10, z: 10, visibility: 1 },
{ x: 11, y: 11, z: 11, visibility: 1 },
{ x: 12, y: 12, z: 12, visibility: 1 },
{ x: 13, y: 13, z: 13, visibility: 1 },
{ x: 14, y: 14, z: 14, visibility: 1 },
{ x: 15, y: 15, z: 15, visibility: 1 },
{ x: 16, y: 16, z: 16, visibility: 1 },
{ x: 17, y: 17, z: 17, visibility: 1 },
{ x: 18, y: 18, z: 18, visibility: 1 },
{ x: 19, y: 19, z: 19, visibility: 1 },
{ x: 20, y: 20, z: 20, visibility: 1 },
{ x: 21, y: 21, z: 21, visibility: 1 },
{ x: 22, y: 22, z: 22, visibility: 1 },
{ x: 23, y: 23, z: 23, visibility: 1 },
{ x: 24, y: 24, z: 24, visibility: 1 },
{ x: 25, y: 25, z: 25, visibility: 1 },
{ x: 26, y: 26, z: 26, visibility: 1 },
{ x: 27, y: 27, z: 27, visibility: 1 },
{ x: 28, y: 28, z: 28, visibility: 1 },
{ x: 29, y: 29, z: 29, visibility: 1 },
{ x: 30, y: 30, z: 30, visibility: 1 },
{ x: 31, y: 31, z: 31, visibility: 1 },
{ x: 32, y: 32, z: 32, visibility: 1 },
{ x: 33, y: 33, z: 33, visibility: 1 }
]
};
const pose = new Pose({
locateFile: (file) => {
return `https://cdn.jsdelivr.net/npm/@mediapipe/pose/${file}`;
},
});
pose.setOptions({
// Options
});
// Pass another function to receive the results
pose.onResults((results) => smoothLandmarks(results, onResutls));
function onResutls(results) {
// Do something with the results
}
// Or get the returned data from the library
pose.onResults((results) => {
// Smooth the landmarks
const smoothResults = smoothLandmarks(results);
// Do something with the smooth results
});
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
mediapipe-pose-smooth © Yousuf
Authored and maintained by Yousuf Kalim.
GitHub @yousufkalim · LinkedIn @yousufkalim
FAQs
This will remove the jitter and smooth the landmarks given by Mediapipe
The npm package mediapipe-pose-smooth receives a total of 7 weekly downloads. As such, mediapipe-pose-smooth popularity was classified as not popular.
We found that mediapipe-pose-smooth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.