"The computer will watch my back for me." A Ukrainian IT guy has developed a solution that "saved" his back while playing the guitar. What makes it interesting
IT Risk management advisor Oleg Matsui shared his development — he wrote a program that analyzes posture while playing the guitar via a webcam and determines whether there are any errors in posture.
IT Risk management advisor Oleg Matsui shared his development — he wrote a program that analyzes posture while playing the guitar via a webcam and determines whether there are any errors in posture.
In his LinkedIn profile, the IT guy reported that he has been playing the guitar for quite a long time, but recently, after music lessons, he began to feel back pain.
«When I started looking for the reason, I realized that I often lean too far to the left, especially when I’m concentrated and playing something quite complex. Since I do it completely unconsciously, it’s quite difficult to fix it on my own. Then I had a simple idea — the computer will watch my back instead of me,» Oleg Matsui told the background of his development.
As a solution to the situation, the IT guy wrote a program that plays a sound signal and reminds him to straighten up.
Its algorithm, as Oleg Matsui noted, looks like this:
the webcam records video during the game;
a computer vision model identifies key points of the body (shoulders, head, back, arms, etc.);
based on the position of these points, the program assesses whether the person has correct posture;
If a person is in a hunched position for too long or sits incorrectly, the program sounds an audible signal to prompt them to straighten up.
The IT Risk management advisor shared that to determine the body pose, he used MediaPipe Pose, which returns 3D coordinates of key points of the body.
«After that, the coordinates are normalized relative to the center of the body so that the model is less dependent on the camera position. The obtained features are fed into a simple logistic regression, which evaluates the position of key points of the body and determines correct or incorrect posture. If the program determines that the posture is incorrect, a timer is started for fifteen seconds, during which the posture must be corrected, otherwise loud music will play and I will be forced to get distracted and analyze what is happening,» he said.
Oleg Matsui also explained that to train the model, he recorded several videos of himself playing the guitar, and during the filming of some of them he specifically played with the correct posture, and some of them, on the contrary, he deliberately leaned into the wrong position.
After that, the coordinates of key points of the body were obtained from each frame, and the IT specialist formed a dataset where each set of coordinates was labeled as a «correct» or «incorrect» posture.
«A logistic regression model was trained on this dataset, which learned to distinguish these two states based on the relative position of the shoulders, head, and torso,» the author of the development added.
In his opinion, this pet project, which combines the hobby of an IT professional and machine learning, can be improved, but even in its current state, the program fully fulfills its tasks. The IT professional also shared the code of his project with those who might be interested.
In a comment to dev.ua, Oleg Matsui noted that he had never worked with computer vision before, but he managed to develop the program quite quickly. «I wrote mostly on weekends,» he added.
«Made for the top 1% of developers.» A Ukrainian developer launched a platform that helps IT professionals prepare for interviews. The site gained over 200 users in a day