-
Notifications
You must be signed in to change notification settings - Fork 76
Adding a transform function to overlay teams #400
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
base: master
Are you sure you want to change the base?
Conversation
85f987a
to
a1cf591
Compare
a1cf591
to
3b6903a
Compare
Let's illustrate how I think it should work. Assume we have a dataset with two corner kicks. One by the blue team and one by the red team. For each corner kick there is one defender in the penalty area. After a "MirrorHorizontal"1 operation, it should look like this. Next, after a "MirrorVertical" operation, it should look like this.
Ideally, this works for both event and tracking data.
Yes, you can use it for the "MirrorHorizontal" operation. Footnotes
|
To be clear, what I wanted to achieve with: #253 is the following: ![]() |
Hi @probberechts and @DriesDeprest Thanks for your explanations and examples! this makes things a lot clearer. One comment I would like to make is that each one of you have a different feature in mind. @probberechts is suggesting is applying horizontal and vertical transformations until we can overlay different actions, like the corner kicks in his example. For that, we could have the "mirror_vertical" and "mirror_horizontal" functions available for the user to apply over all players in a frame or event until they have these players rotated to a specific position. On another hand, @DriesDeprest suggestion seems to be overlaying formations. I would rotate one of the teams for two players playing on the same position for opposed teams to be on the same position on the field. But, in this case, if I apply this transform for the corners I would rotate the corner kicker but not the defender. For this one, it would be possible to refactor the flip_point to call a "mirror_vertical" and "mirror_horizontal" functions and then also expose these new functions to allow for both suggestions |
If I understand it correctly, what @DriesDeprest suggests is the combination of a MirrorHorizontal + MirrorVertical operation (in his example applied to the away team). I considered that both of these operations would be useful, hence why I initially proposed to split it up in those two transformations. |
@probberechts and @DriesDeprest I kept the overlay option to flip the coordinates of the team facing left to right, but this is now using the the mirror operations. Appreciate any comment you have over this! If this implementation is good I will add support for events as well |
I still think we need a different "concept" for these kinds of data operations. They are clearly a different operation than changing the orientation or pitch dimensions. Cfr. my previous remark:
Currently, I find both the API and implementation a bit messy and I feel that separating things will help. Maybe we should define these operations as
or dataset
.transform(...)
.normalize(playing_direction='left_to_right', side_of_pitch='left') Apologies if this causes any confusion—I'm just brainstorming some ideas. But I feel that we should first precisely define what we exactly want and carefully think through the API design. |
Adding a new transformation function intended to position all players in a frame pointing to the same direction, overlaying them instead of the traditional orientation where tam A faces team B
This PR implements the issue #253
Some questions I have about the issue and this implementation are:
Appreciate any comments on this @probberechts and @DriesDeprest