Domain specific language based applications for monitoring user movements
A system generates applications based on a domain specific language (DSL). The applications allow a user to take measurements based on user movements using a client device (for example, a mobile phone) for providing to an expert. The domain specific language includes commands that cause the generated applications to perform various tasks, such as providing specific instructions to the user, starting and stopping recording, taking measurements, and so on. The system compiles the DSL specification to generate executable instructions that are deployed (for example, on a client device such as a mobile phone). The DSL specification allows users to specify virtual points based on multiple landmarks obtained from the images of the user. The DSL specification allows users to specify a point as a stable point for landmarks that are expected to be stationary but move across frames.
1 . A computer-implemented method for generating applications based on a domain specific language (DSL), the computer-implemented method comprising:
receiving DSL specification for an application for capturing measurements based on user movements, the DSL specification comprising a set of DSL commands, the set of DSL commands comprising at least a DSL command for measuring an angle based on body parts;
compiling the DSL specification to generate a set of instructions for implementing the set of DSL commands, wherein the set of instructions when executed by a device, cause the device to perform steps comprising:
receiving one or more images of a user;
identifying an anchor point, a first point and a second point based on body parts detected in the one or more images; and
determining an angle based on the one or more images, the angle between a first vector formed by the anchor point and the first point and a second vector formed by the anchor point and the second point; and
deploying the set of instructions on a computing system causing the computing system to take a set of measurements based on user movements and provide the set of measurements to a target system for review.
2 . The computer-implemented method of claim 1 , wherein the DSL specification includes a pose body command that specifies a set of required body parts, wherein instructions generated for the pose body command perform interactions with the user to capture an image of the user that includes all of the set of required body parts.
3 . The computer-implemented method of claim 2 , wherein responsive to determining that the image fails to include all of the set of required body parts, instructing the user to adjust a position of the user.
4 . The computer-implemented method of claim 1 , wherein the DSL specification includes a first DSL command to start recording and a second DSL command to stop recording, wherein the DSL specification further includes one or more DSL commands for taking measurements between the first DSL command and the second DSL command.
5 . The computer-implemented method of claim 1 , wherein the set of instructions is deployed on a client device equipped with a camera, wherein the client device executes the set of instructions.
6 . The computer-implemented method of claim 1 , wherein the set of instructions is deployed on an online system that interacts with a client device equipped with a camera, wherein the client device sends requests to the online system to execute the set of instructions.
7 . The computer-implemented method of claim 1 , wherein the set of instructions when executed by a device, further cause the device to perform steps comprising:
instructing a user to hold a pose for at least a threshold amount of time.
8 . A non-transitory computer readable storage medium for storing instructions that when executed by one or more computer processors cause the one or more computer processors to perform steps for generating applications based on a domain specific language (DSL), the steps causing the one or more computer processors to perform steps comprising:
receiving DSL specification for an application for capturing measurements based on user movements, the DSL specification comprising a set of DSL commands, the set of DSL commands comprising at least a DSL command for measuring an angle based on body parts;
compiling the DSL specification to generate a set of instructions for implementing the set of DSL commands, wherein the set of instructions when executed by a device, cause the device to perform steps comprising:
receiving one or more images of a user;
identifying an anchor point, a first point and a second point based on body parts detected in the one or more images; and
determining an angle based on the one or more images, the angle between a first vector formed by the anchor point and the first point and a second vector formed by the anchor point and the second point; and
deploying the set of instructions on a computing system causing the computing system to take a set of measurements based on user movements and provide the set of measurements to a target system for review.
9 . The non-transitory computer readable storage medium of claim 8 , wherein the DSL specification includes a pose body command that specifies a set of required body parts, wherein instructions generated for the pose body command perform interactions with the user to capture an image of the user that includes all of the set of required body parts.
10 . The non-transitory computer readable storage medium of claim 9 , wherein responsive to determining that the image fails to include all of the set of required body parts, instructing the user to adjust a position of the user.
11 . The non-transitory computer readable storage medium of claim 8 , wherein the DSL specification includes a first DSL command to start recording and a second DSL command to stop recording, wherein the DSL specification further includes one or more DSL commands for taking measurements between the first DSL command and the second DSL command.
12 . The non-transitory computer readable storage medium of claim 8 , wherein the set of instructions is deployed on a client device equipped with a camera, wherein the client device executes the set of instructions.
13 . The non-transitory computer readable storage medium of claim 8 , wherein the set of instructions is deployed on an online system that interacts with a client device equipped with a camera, wherein the client device sends requests to the online system to execute the set of instructions.
14 . The non-transitory computer readable storage medium of claim 8 , wherein the set of instructions when executed by a device, further cause the device to perform steps comprising:
instructing a user to hold a pose for at least a threshold amount of time.
15 . A computer system comprising:
one or more computer processors; and
a non-transitory computer readable storage medium for storing instructions that, when executed by the one or more computer processors cause the one or more computer processors to perform steps for generating applications based on a domain specific language (DSL), the steps causing the one or more computer processors to perform steps comprising:
receiving DSL specification for an application for capturing measurements based on user movements, the DSL specification comprising a set of DSL commands, the set of DSL commands comprising at least a DSL command for measuring an angle based on body parts;
compiling the DSL specification to generate a set of instructions for implementing the set of DSL commands, wherein the set of instructions when executed by a device, cause the device to perform steps comprising:
receiving one or more images of a user;
identifying an anchor point, a first point and a second point based on body parts detected in the one or more images; and
determining an angle based on the one or more images, the angle between a first vector formed by the anchor point and the first point and a second vector formed by the anchor point and the second point; and
deploying the set of instructions on a computing system causing the computing system to take a set of measurements based on user movements and provide the set of measurements to a target system for review.
16 . The computer system of claim 15 , wherein the DSL specification includes a pose body command that specifies a set of required body parts, wherein instructions generated for the pose body command perform interactions with the user to capture an image of the user that includes all body parts of the set of required body parts.
17 . The computer system of claim 16 , wherein responsive to determining that the image fails to include all of the set of required body parts, one or more instructions communicate with the user, instructing the user to adjust a position of the user.
18 . The computer system of claim 15 , wherein the DSL specification includes a first DSL command to start recording and a second DSL command to stop recording, wherein the DSL specification further includes one or more DSL commands for taking measurements between the first DSL command and the second DSL command.
19 . The computer system of claim 15 , wherein the set of instructions is deployed on one of:
(1) a client device equipped with a camera, wherein the client device executes the set of instructions, or
(2) an online system that interacts with a client device equipped with a camera, wherein the client device sends requests to the online system to execute the set of instructions.
20 . The computer system of claim 15 , wherein the set of instructions when executed by a device, further cause the device to perform steps comprising:
instructing a user to hold a pose for at least a threshold amount of time.