Comments (4)
Ah yes, I think we decided not to include this since it wasn't part of what the native model anymore. I can see how it could be nice to bring back! From my own experience, I very rarely had students use the skeleton connections, the actual points are almost always what they focused on. @MOQN I know you taught quite a bit with PoseNet, what do you think? Is it worth the extra effort and maintenance required to add this data into the model output?
@ziyuan-linn also, if you recall anything different from our conversations, let us know!
from ml5-next-gen.
Yes, I also remember that we decided to not include it. If I recall correctly we were also planning on making an example p5 sketch that draws the skeleton connections manually.
from ml5-next-gen.
I'm looking at the @tfjs-model now and I'm not seeing any equivalent to the getAdjacentKeyPoints
method. If we wanted to implement this ourselves, we can look at the source from the old PoseNet. It's pretty simple. We would need to:
- Define the pairings of connected points (names or indices) for each model
const connectedPartNames: StringTuple[] = [
['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],
['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],
['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],
['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],
['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],
['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip']
];
export const connectedPartIndices = connectedPartNames.map(
([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));
-
Map these pairings to the detected points
-
Remove any connections where one or both points was not found, or was low-confidence.
function eitherPointDoesntMeetConfidence(
a: number, b: number, minConfidence: number): boolean {
return (a < minConfidence || b < minConfidence);
}
export function getAdjacentKeyPoints(
keypoints: Keypoint[], minConfidence: number): Keypoint[][] {
return connectedPartIndices.reduce(
(result: Keypoint[][], [leftJoint, rightJoint]): Keypoint[][] => {
if (eitherPointDoesntMeetConfidence(
keypoints[leftJoint].score, keypoints[rightJoint].score,
minConfidence)) {
return result;
}
result.push([keypoints[leftJoint], keypoints[rightJoint]]);
return result;
}, []);
}
from ml5-next-gen.
I agree with the approach! Since many students tend to visualize the skeleton using their own aesthetics, providing an example of manually drawing individual skeletal parts could be helpful for our students.
from ml5-next-gen.
Related Issues (20)
- `bodyPose` bounding box coordinates are in the 0-1 range HOT 1
- CDN for ml5.js release HOT 8
- Error in neuralNetrwork "mouse gesture" example if you click without dragging
- Question about Neural Network normalization HOT 2
- Error installing dependencies HOT 7
- Another alpha release? HOT 6
- Testing new p5 mirror function HOT 5
- `faceMesh` lips missing `keypoint` 291 HOT 3
- Discussion: `NeuralNetwork`
- README references and examples page? HOT 1
- setBackend() required for ml5.neuralNetwork() bug HOT 4
- ml5 file size HOT 5
- Memory leak in PoseNet's video processing pattern HOT 5
- make api compatible with code using legacy library HOT 1
- why pose keypoints x and y positions will misalign the video stream whenever the video size is not (640, 480) HOT 1
- `confidence` vs `score` across all models HOT 2
- Minor errors in documentation.md HOT 1
- Incorporating "flipped" property
- Making `tfjs` runtime the default HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ml5-next-gen.