{"id":196583,"date":"2020-02-01T12:02:44","date_gmt":"2020-02-01T09:02:44","guid":{"rendered":"http:\/\/ww-vb.mine.nu\/w108\/how-to-implement-pose-estimation-in-a-browser-using-your-webcam\/"},"modified":"2020-02-01T12:02:44","modified_gmt":"2020-02-01T09:02:44","slug":"how-to-implement-pose-estimation-in-a-browser-using-your-webcam","status":"publish","type":"post","link":"https:\/\/hameed.nwar.uk\/sa\/how-to-implement-pose-estimation-in-a-browser-using-your-webcam\/","title":{"rendered":"How to implement pose estimation in a browser using your webcam"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div>\n<h2 id=\"75ef\" class=\"it iu es ar aq iv eu iw ew ix iy iz ja jb jc jd je\">Coding time<\/h2>\n<p id=\"5971\" class=\"jf jg es ar jh b fl ji fn jj jk jl jm jn jo jp jq ek\" data-selectable-paragraph=\"\">We will use a webcam as the video input to our pose estimation model and show the output on our main page<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">index.html<\/code>.<\/p>\n<p id=\"2560\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We are using two libraries here:<\/p>\n<ul class=\"\">\n<li id=\"1ec0\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">ml5.js<\/code><span>\u00a0<\/span>for creating and running our ML model.<\/li>\n<li id=\"dc1d\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">p5.js<\/code><span>\u00a0<\/span>for getting the webcam video feed and displaying output in our browser.<\/li>\n<\/ul>\n<p id=\"63dd\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">I\u2019ve added extensive documentation inside the code, explaining every single line. Here, we will discuss the main crux which is the majority of the code anyway.<\/p>\n<p id=\"03d0\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">Our code consists of two files:<\/p>\n<ul class=\"\">\n<li id=\"5761\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">poseNet_webcam.js<\/code>, our JavaScript code.<\/li>\n<li id=\"8e18\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">index.html<\/code>, the main page to show output.<\/li>\n<\/ul>\n<h2 id=\"5ecf\" class=\"lz iu es ar aq iv ma mb mc md me mf mg mh mi mj mk\" data-selectable-paragraph=\"\">PoseNet_webcam.js<\/h2>\n<p id=\"a639\" class=\"jf jg es ar jh b fl ji fn jj jk jl jm jn jo jp jq ek\" data-selectable-paragraph=\"\"><code class=\"ie lr ls lt lu b\">p5.js<\/code>\u00a0runs two functions:<\/p>\n<ul class=\"\">\n<li id=\"6d9b\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">function setup()<\/code>. The first function that is executed and runs only once. We will do our initial setup in it.<\/li>\n<li id=\"5f63\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">function draw()<\/code>. This function is called on repeat forever (unless you plan on closing the browser or pressing the power button).<\/li>\n<\/ul>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed ml\">\n<div class=\"id r bl ie\">\n<div class=\"mm r\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" width=\"555\" height=\"442\" src=\"https:\/\/miro.medium.com\/max\/555\/1*7XPisaXgva97r2beNrfrpg.png\" data-lazy=\"true\"\/><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"8a96\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\"><code class=\"ie lr ls lt lu b\">createCanvas(width, height)<\/code><span>\u00a0<\/span>is provided by p5 to create a box in the browser to show our output. Here, canvas has<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">width: 640px<\/code><span>\u00a0<\/span>and<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">height: 480px<\/code>.<\/p>\n<p id=\"3ac9\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\"><code class=\"ie lr ls lt lu b\">createCapture(VIDEO)<\/code><span>\u00a0<\/span>is used to capture a webcam feed and return a p5 element object, which we will name<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">webcam_output<\/code>. We set the webcam video to the same height and width of our canvas.<\/p>\n<p id=\"963c\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\"><code class=\"ie lr ls lt lu b\">ml5.poseNet()<\/code><span>\u00a0<\/span>creates a new PoseNet model, taking as input:<\/p>\n<ul class=\"\">\n<li id=\"4994\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq jr js jt\" data-selectable-paragraph=\"\">Our present webcam output.<\/li>\n<li id=\"2d95\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">A<span>\u00a0<\/span>callback function, which is called when the model is successfully loaded. Inside our<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">index.html<\/code><span>\u00a0<\/span>file, we have created an HTML paragraph with an ID\u00a0<code class=\"ie lr ls lt lu b\">status<\/code><span>\u00a0<\/span>showing the current status text to the user. We change that text to<span>\u00a0<\/span><em class=\"lo\">Model Loaded<span>\u00a0<\/span><\/em>for the user to know, as the model takes a bit to load<em class=\"lo\">.<\/em>\n<\/li>\n<\/ul>\n<p id=\"de84\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\"><code class=\"ie lr ls lt lu b\">poseNet.on()<\/code><span>\u00a0<\/span>is a trigger or event listener. Whenever the webcam gives a new image, it is given to the PoseNet model.<\/p>\n<p id=\"e6ab\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">The moment pose is detected and output is ready. It calls<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">function(results)<\/code>, where<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">results<\/code>\u00a0is the final output of<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">keypoints<\/code><span>\u00a0<\/span>and scores given by the model.<\/p>\n<p id=\"25fe\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We store this in our<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">poses<\/code><span>\u00a0<\/span>array, which is globally defined and can be used anywhere in our code.<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">webcam_output.hide()<\/code><span>\u00a0<\/span>hides the webcam output for now, as we will modify the images and show the image with detected points and lines later.<\/p>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed mn\">\n<div class=\"id r bl ie\">\n<div class=\"mo r\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" width=\"490\" height=\"234\" src=\"https:\/\/miro.medium.com\/max\/490\/1*aepbsCeUatjTvS2zSaA06Q.png\" data-lazy=\"true\"\/><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"856c\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">All we have left to do is to show the image with all the detection results stored in<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">poses<\/code><span>\u00a0<\/span>in the browser.<\/p>\n<p id=\"55d1\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">As we know, the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">draw()<\/code><span>\u00a0<\/span>function runs in a loop forever. Inside this, we call the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">image()<\/code><span>\u00a0<\/span>function to display our image (as we have our video image-by-image) in the canvas.<\/p>\n<p id=\"c8a9\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">It takes five arguments:<\/p>\n<ul class=\"\">\n<li id=\"0318\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">input image<\/code>. The image we want to display.<\/li>\n<li id=\"e652\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">x position<\/code>. The x-coordinate of the top-left corner of the image in respect to the canvas.<\/li>\n<li id=\"1e50\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">y position<\/code>. The y-coordinate of the top-left corner of the image in respect to the canvas.<\/li>\n<li id=\"4658\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">width<\/code>. The width to draw the image.<\/li>\n<li id=\"4fdd\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">height<\/code>. The height to draw the image.<\/li>\n<\/ul>\n<p id=\"caa4\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We then call<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">drawKeyPoints()<\/code><span>\u00a0<\/span>and<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">drawSkeleton()<\/code><span>\u00a0<\/span>to draw the<span>\u00a0<\/span><em class=\"lo\">dots and lines<span>\u00a0<\/span><\/em>on the current image.<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">draw()<\/code><span>\u00a0<\/span>does this in an infinite loop, hence showing a continuous output to the user, which makes it look like a video.<\/p>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"hw hx bl hy ak\">\n<div class=\"ec ed mp\">\n<div class=\"id r bl ie\">\n<div class=\"mq r\">\n<figure class=\"post-image post-mediaBleed aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" alt=\"\" width=\"809\" height=\"805\" src=\"https:\/\/miro.medium.com\/max\/809\/1*dClYxLdf-7b-TK4QigPdBg.png\" data-lazy=\"true\"\/><figcaption><a href=\"https:\/\/thenextweb.com\/#\" data-url=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fthenextweb.com%2Fsyndication%2F2020%2F02%2F01%2Fmachine-learning-for-everyone-how-to-implement-pose-estimation-in-a-browser-using-your-webcam%2F&amp;via=thenextweb&amp;related=thenextweb&amp;text=Check out this picture on: A typical JS object output of PoseNet\" data-title=\"Share A typical JS object output of PoseNet on Twitter\" data-width=\"685\" data-height=\"500\" class=\"post-image-share popitup\" title=\"Share A typical JS object output of PoseNet on Twitter\"><i class=\"icon icon--inline icon--twitter--dark\"\/><\/a>A typical JS object output of PoseNet<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"d2fe\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">As you can see above, PoseNet returns a JavaScript object as output, consisting of many key-value pairs. This is the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">pose<\/code><span>\u00a0<\/span>key-value out of the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">pose<\/code><span>\u00a0<\/span>and<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">skeleton<\/code><span>\u00a0<\/span>values, provided for each person in an image.<\/p>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed mr\">\n<div class=\"id r bl ie\">\n<div class=\"ms r\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" width=\"650\" height=\"525\" src=\"https:\/\/miro.medium.com\/max\/650\/1*dMS9-tknztdcSumiP59zGQ.png\" data-lazy=\"true\"\/><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"f07f\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We have a function to draw detected points on the image. Remember, we saved all the results from the PoseNet output in the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">poses<\/code><span>\u00a0<\/span>array. Here, we loop through every<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">pose<\/code><span>\u00a0<\/span>or person in an image and get its<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">keypoints<\/code>.<\/p>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed mt\">\n<div class=\"id r bl ie\">\n<div class=\"mu r\">\n<figure class=\"post-image post-mediaBleed aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" alt=\"\" width=\"501\" height=\"86\" src=\"https:\/\/miro.medium.com\/max\/501\/1*4_Hv2UqmXKE9sNZME0TSlg.png\" data-lazy=\"true\"\/><figcaption><a href=\"https:\/\/thenextweb.com\/#\" data-url=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fthenextweb.com%2Fsyndication%2F2020%2F02%2F01%2Fmachine-learning-for-everyone-how-to-implement-pose-estimation-in-a-browser-using-your-webcam%2F&amp;via=thenextweb&amp;related=thenextweb&amp;text=Check out this picture on: Inside a point in the keypoints array\" data-title=\"Share Inside a point in the keypoints array on Twitter\" data-width=\"685\" data-height=\"500\" class=\"post-image-share popitup\" title=\"Share Inside a point in the keypoints array on Twitter\"><i class=\"icon icon--inline icon--twitter--dark\"\/><\/a>Inside a point in the keypoints array<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"1cea\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We loop through every<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">point<\/code><span>\u00a0<\/span>that is a body part in the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">keypoints<\/code><span>\u00a0<\/span>array, which further has:<\/p>\n<ul class=\"\">\n<li id=\"b74e\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">part<\/code>. The name of the part detected.<\/li>\n<li id=\"3978\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">position<\/code>. x and y values of a point in the image.<\/li>\n<li id=\"33e4\" class=\"jf jg es ar jh b fl jy fn jz jk ka jm kb jo kc jq jr js jt\" data-selectable-paragraph=\"\">\n<code class=\"ie lr ls lt lu b\">score<\/code>. Accuracy of detection.<\/li>\n<\/ul>\n<p id=\"5726\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We only draw a<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">point<\/code>\u00a0if the accuracy of detection is greater than\u00a0<code class=\"ie lr ls lt lu b\">0.2<\/code>. We call<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">fill(red, green, blue)<\/code>, taking RGB intensity value ranging from<span>\u00a0<code class=\"ie lr ls lt lu b\">0 <\/code><\/span><code class=\"ie lr ls lt lu b\">to 255<\/code><span>\u00a0<\/span>to decide the color of a point, and<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">noStroke()<\/code><span>\u00a0<\/span>to disable drawing the outline that p5 draws by default.<\/p>\n<p id=\"71c2\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">Then, we call<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">ellipse(x_value, y_value, width, height)<\/code><span>\u00a0<\/span>to draw an ellipse at the desired position but we keep the width and height very small, which makes them look like a dot (exactly what we wanted).&lt;\/p&gt;<\/p>\n<p id=\"9877\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">Similarly, as our variable\u00a0<code class=\"ie lr ls lt lu b\">poses<\/code><span>\u00a0<\/span>has multiple\u00a0<code class=\"ie lr ls lt lu b\">pose<\/code>\u2018s in it, it also has multiple\u00a0<code class=\"ie lr ls lt lu b\">skeleton<\/code>\u00a0values with their own type of key-value pairs, which is handled by<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">drawSkeleton()<\/code><span>\u00a0<\/span>drawing lines instead of points.<\/p>\n<h2 id=\"d5e8\" class=\"lz iu es ar aq iv ma mb mc md me mf mg mh mi mj mk\" data-selectable-paragraph=\"\">index.html<\/h2>\n<p id=\"2f0e\" class=\"jf jg es ar jh b fl ji fn jj jk jl jm jn jo jp jq ek\" data-selectable-paragraph=\"\">This is the main page where we display our output. We add all our libraries using script tags.<\/p>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"hw hx bl hy ak\">\n<div class=\"ec ed mv\">\n<div class=\"id r bl ie\">\n<div class=\"mw r\">\n<figure class=\"post-image post-mediaBleed aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" alt=\"\" width=\"953\" height=\"178\" src=\"https:\/\/miro.medium.com\/max\/953\/1*zO7VSOAv82soG2gYu0l5Qw.png\" data-lazy=\"true\"\/><figcaption><a href=\"https:\/\/thenextweb.com\/#\" data-url=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fthenextweb.com%2Fsyndication%2F2020%2F02%2F01%2Fmachine-learning-for-everyone-how-to-implement-pose-estimation-in-a-browser-using-your-webcam%2F&amp;via=thenextweb&amp;related=thenextweb&amp;text=Check out this picture on: The ml5.js and p5.js libraries\" data-title=\"Share The ml5.js and p5.js libraries on Twitter\" data-width=\"685\" data-height=\"500\" class=\"post-image-share popitup\" title=\"Share The ml5.js and p5.js libraries on Twitter\"><i class=\"icon icon--inline icon--twitter--dark\"\/><\/a>The ml5.js and p5.js libraries<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed mx\">\n<div class=\"id r bl ie\">\n<div class=\"my r\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" width=\"493\" height=\"260\" src=\"https:\/\/miro.medium.com\/max\/493\/1*mMQwuHWBCmqKm2bbh_vlhQ.png\" data-lazy=\"true\"\/><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"7cd2\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">We show a cute welcome intro to the user. As model loading takes time, we show the \u2018<em class=\"lo\">Loading model\u2026\u2019<span>\u00a0<\/span><\/em>message. If you remember, we change it to \u2018<em class=\"lo\">Model Loaded\u2019<span>\u00a0<\/span><\/em>once our model is loaded using the reference on an ID, called<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">status<\/code>.<\/p>\n<p id=\"4c4e\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">At last, we put our own JS code inside the body. Run the<span>\u00a0<\/span><code class=\"ie lr ls lt lu b\">index.html<\/code><span>\u00a0<\/span>file to see the output. Make sure you allow webcam access when prompted.<\/p>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed mz\">\n<div class=\"id r bl ie\">\n<div class=\"na r\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" width=\"600\" height=\"602\" src=\"https:\/\/miro.medium.com\/max\/600\/1*pVPUKC-SPT2Vg4vLWdN6iA.gif\" data-lazy=\"true\"\/><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<figure class=\"hq hr hs ht hu hv ec ed paragraph-image\">\n<div class=\"ec ed mz\">\n<div class=\"id r bl ie\">\n<div class=\"nb r\">\n<figure class=\"post-image post-mediaBleed aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"qc sj cr t u ia ak ij lazy\" role=\"presentation\" alt=\"\" width=\"600\" height=\"600\" src=\"https:\/\/miro.medium.com\/max\/600\/1*RPBw9EuFTWPtVWcGdHYG-Q.gif\" data-lazy=\"true\"\/><figcaption><a href=\"https:\/\/thenextweb.com\/#\" data-url=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fthenextweb.com%2Fsyndication%2F2020%2F02%2F01%2Fmachine-learning-for-everyone-how-to-implement-pose-estimation-in-a-browser-using-your-webcam%2F&amp;via=thenextweb&amp;related=thenextweb&amp;text=Check out this picture on: PoseNet in action. Image from the\u00a0official Tensorflow medium blog.\" data-title=\"Share PoseNet in action. Image from the\u00a0official Tensorflow medium blog. on Twitter\" data-width=\"685\" data-height=\"500\" class=\"post-image-share popitup\" title=\"Share PoseNet in action. Image from the\u00a0official Tensorflow medium blog. on Twitter\"><i class=\"icon icon--inline icon--twitter--dark\"\/><\/a>PoseNet in action. Image from the\u00a0official Tensorflow medium blog.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"be59\" class=\"jf jg es ar jh b fl kn fn ko jk kp jm kq jo kr jq ek\" data-selectable-paragraph=\"\">That\u2019s it! You can always go to the<span>\u00a0<\/span>ml5.js reference page, which has many more ready-to-use mode and code snippets for various cool ML projects, dealing with a wide variety of things like text, images, and sound.<\/p>\n<p data-selectable-paragraph=\"\"><em>Kartik Nighania is a a machine learning enthusiast who loves computer vision more than NLP. He previously worked in the field of robotics especially drones which haunts me to this date. In love with Kaggle.<\/em><\/p>\n<\/div>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><br \/>\n<br \/>[ad_2]<br \/>\n<br \/><a href=\"https:\/\/thenextweb.com\/syndication\/2020\/02\/01\/machine-learning-for-everyone-how-to-implement-pose-estimation-in-a-browser-using-your-webcam\/\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Coding time We will use a webcam as the video input to our pose estimation model and show the output on our main page\u00a0index.html. We are using two libraries here: ml5.js\u00a0for creating and running our ML model. p5.js\u00a0for getting the webcam video feed and displaying output in our browser. I\u2019ve added extensive documentation inside &hellip;<\/p>\n","protected":false},"author":1,"featured_media":196584,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-196583","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tie-world"],"_links":{"self":[{"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/posts\/196583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/comments?post=196583"}],"version-history":[{"count":0,"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/posts\/196583\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/media\/196584"}],"wp:attachment":[{"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/media?parent=196583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/categories?post=196583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hameed.nwar.uk\/sa\/wp-json\/wp\/v2\/tags?post=196583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}