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

Shot trainer #113

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
started work on adding features
  • Loading branch information
dtracers committed Sep 17, 2018
commit d84801c4722754417ef2b032e7a042283a4d0bb5
28 changes: 25 additions & 3 deletions examples/replays/shots/shot_input_formatter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pandas as pd
import numpy as np
from framework.input_formatter.base_input_formatter import BaseInputFormatter
from framework.replay.replay_format import GeneratedHit

Expand All @@ -12,10 +13,31 @@ def create_input_array(self, input_data: GeneratedHit, batch_size=1):
hit = input_data.get_hit()
frame = hit.frame_number
df = input_data.get_replay().get_pandas()
df.set_index(('index',), inplace=True)
index = df.index
hit_frame = df.loc[frame]

result = input_data.get_replay().get_pandas()
index = input_data.get_replay().get_pandas().loc[frame].index
new_frame = hit_frame['ball']

proto = input_data.get_replay().get_proto()
hit_player = hit.player_id
blue_team = []
orange_team = []
for player in proto.players:
if player.is_orange:
orange_team.append(player)
else:
blue_team.append(player)


return result

def get_speed(self, frame):
return np.sqrt(frame['vel_x']**2 + frame['vel_y']**2 + frame['vel_z']**2)

def get_distance_from_goal(self, frame, player):


def get_player_data(self, frame):
return [frame['pos_x'], frame['pos_y'], frame['pos_z'],
frame['rot_x'], frame['rot_y'], frame['rot_z'],
frame['vel_x'], frame['vel_y'], frame['vel_z']]