[PYTHON] I tried to expand the database so that it can be used with PES analysis software
We will automate the data analysis of PES! Part7
- Thank you ** Yajun **.
Also, the number of PES events has increased!
** Twitter Bot made for event memorandum ** The number of followers has increased ♪ (currently 230 people)
- ** Happy voices from bot users **
When I get this kind of voice, I'm glad I made it!
I want the organizers and companies of the tournament and events to spread the word to the point where they can use it.
■ Contents of this article
- This time, we will introduce the data management of analysis software, which has been expanded so that it can be performed not only in CSV but also in databases.
The software in this article is written in python. ■ Reference URL
▼ List of extended functions of analysis application
- The following functions have been expanded from the previous article.
- Player authentication function
- Data reading function from database
- A function to output metric data in CSV from the match result image
- Ability to add CSV metrics data to the database
■ Background to database management
- Until now, data management was done with CSV files.
CSV management has the advantage of being able to analyze data even offline.
However, in order to grow master data in the future, each CSV file must be ** merged **.
It's too annoying!
So move on to database management!
Master data will grow even if it is left unattended if a mechanism is created in which the analysis results of each player are aggregated in a database.
■ Introduction for each extension
▼ What is the database like?
- Use SQL.
MySQL Build an environment and migrate the existing CSV data.
● When you actually move, it looks like this ↓
- Use HeidiSQL to check the data.
We have transferred the results of 150 games collected from testers so far.
▼ Read data from database
- Added user authentication function.
If the user name and password you entered are managed in the database, you can read the data.
● Data manipulation from user authentication looks like this
- Since this is a demo operation, the password is also set to the demo "Password".
First, I read the data of "Yajun", and then I read the data of "Masataro".
Since the users have changed, the types of gauge charts and radar charts have changed.
▼ CSV file output from image data
- Metric data is extracted from the match result image and output to CSV.
Realizing this function is the most difficult and takes a lot of man-hours lol
● From user authentication to CSV output like this
- Enter your username and password and press the Start button to bring up the folder selection screen.
Select the folder that contains the match result image.
Then, the match result image is displayed, so the user confirms whether he is on the Home side or the Away side, and selects his team from the displayed radio button.
When the process is completed, "output.csv" is output to the folder containing the match result image and it is completed.
● Contents of the specified folder after image processing
- Contains 6 match result images required for this software (2 matches in a set of 3 matches per match).
If it is a set of three, the order of "team stats", "attack area", and "ball capture area" can be messed up.
▼ Add to database
- Confirm that the CSV file is output and then click the "Apped" button to add it to the database.
● Database after addition
- If you check the database, the bottom line contains the match results of "2 to 4" and "4 to 6".
If you compare it with the image published in "● Image processing and the contents of the specified folder" above, you can see that the data extracted from the 6 images is included.
■ Remaining tasks
I think it's a bug. ..
In my opinion, bug fix is the most growing experience, so I would like to take it positively.
- I think it's okay to start machine learning if we collect data for about 1000 games.
What we are doing now is Data Visualization, and humans have to consider the trends from there. not.
I want to make this tendency judgment soft ♪
Because python has excellent libraries such as scikit-learn and TensorFlow. I'm looking forward to it.
Personally, who will win if XX players and XX players are played against each other! ?? I want to let you do something like that softly! Lol
For that purpose, this analysis software is necessary as a mechanism for collecting data.
I think we were able to implement the minimum functions as an app.
I think collecting images for analysis is a hassle, but
Since you can specify the folder by collecting the screenshots taken with PS4 into one folder,
Is it less annoying than I expected? I think.
In response to the previous article, I received a question, "Isn't it possible to collect data directly from PS4?"
People who have published the API of PS4, so I will consider the technology!
These voices are valuable! Thank you for your feedback.
This article ends here! Please look forward to the next time ♪
■ Reference URL