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

Inverted coordinate bug #339

Open
UnravelSports opened this issue Jul 17, 2024 · 0 comments
Open

Inverted coordinate bug #339

UnravelSports opened this issue Jul 17, 2024 · 0 comments

Comments

@UnravelSports
Copy link
Contributor

Hi,

I just noticed some really strange behaviour, and I'm not sure what the cause could be.

I load some skillcorner data using the available skillcorner test files. When I load them with limit=4 and limit=50 the coordinates are inverted for all players (see results for player 10326 below), without changing any other parameters.

dataset = DatasetTransformer.transform_dataset(
        dataset=skillcorner.load(
            raw_data='kloppy/tests/files/skillcorner_structured_data.json',
            meta_data='kloppy/tests/files/skillcorner_match_data.json',
            coordinates="secondspectrum", 
            include_empty_frames=False,
            limit=4
        ),        
        to_orientation=Orientation.STATIC_HOME_AWAY 
    )
   frame_id    10326_x    10326_y
0      1523  25.986308  27.301360
1      1524  25.758947  27.243045
2      1525  25.510344  27.217471
3      1526  25.240500  27.224637
dataset = DatasetTransformer.transform_dataset(
        dataset=skillcorner.load(
            raw_data='kloppy/tests/files/skillcorner_structured_data.json',
            meta_data='kloppy/tests/files/skillcorner_match_data.json',
            coordinates="secondspectrum", 
            include_empty_frames=False,
            limit=50
        ),        
        to_orientation=Orientation.STATIC_HOME_AWAY 
    )
   frame_id    10326_x    10326_y
0      1523 -25.986308 -27.301360
1      1524 -25.758947 -27.243045
2      1525 -25.510344 -27.217471
3      1526 -25.240500 -27.224637

I tried replicating the issue while loading the open dataset with 2 different values for limit, but that didn't have the same effect.

dataset = DatasetTransformer.transform_dataset(
        dataset=skillcorner.load_open_data(
            coordinates="secondspectrum", 
            include_empty_frames=False,
            limit=500
        ),        
        to_orientation=Orientation.STATIC_HOME_AWAY 
    )

I'm assuming this is either because we're using the test files and they aren't complete, or because we're trying to figure out the direction of play on a couple frames and setting limit=4 only gives us 2 frames (because of include_empty_frames=False) which wouldn't be enough in this case to figure out direction of play correctly.

Curious to hear your thoughts, because if we're inferring direction of play on an incomplete set of players in the SkillCorner data (I think the data we use here has only the players in the broadcast) then that might be a bug we need to fix?

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