Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim video to exercise #6

Open
MasterMedo opened this issue Aug 31, 2021 · 0 comments
Open

trim video to exercise #6

MasterMedo opened this issue Aug 31, 2021 · 0 comments

Comments

@MasterMedo
Copy link
Owner

MasterMedo commented Aug 31, 2021

Create a python function with the following declaration:

trim_video_to_exercise(
    body_part_positions: list[list[list[float, float, float]]]
) -> tuple[int, int]

The function should take in a list of body part positions at all frames of the video and return the starting and ending frame at which the exercise is found.

The input list has as many elements as there are frames.
Elements of the initial list are body part position lists.
Body part position lists have 17 elements, one for each body part that is being detected.
Each element of the body part position list is [x coordinate, y coordinate, confidence].
Here is the example input:

[
    [
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
    ],
    # ... the rest of the frames
    [
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
        [0.4, 0.3, 0.8],
    ]
]

The output is a tuple of starting and ending frame.
Here is an example output:

(123, 1806)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant