Skip to content

A Python program that utilizes CNN to identify enemy champions on the minimap

Notifications You must be signed in to change notification settings

dcheng728/League-Minimap-Scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation







League Map Scanner (V 1.0.0)

Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)

[‘ashe’, ‘blitzcrank’, ‘brand’, ‘caitlyn’, ‘cassiopeia’, ‘darius’, ‘drmundo’, ‘ezreal’, ‘fiddlestick’,’ garen’, ‘graves’, ‘jax’, ‘karthus’, ‘kayle’, ‘malphite’, ‘nasus’, ‘nidalee’, ‘renekton’, ‘ryze’, ‘shen’,’ sivir’, ‘soraka’, ‘tristana’, ‘trundle’, ‘udyr’, ‘vladimir’, ‘warwick’, ‘wukong’, ‘ziggs’, ‘zilean’, ‘zyra’]

https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
I will keep updating the algorithm to support more champions and increase the accuracy :)

Required dependencies:
Opencv, Tensorflow, Numpy, PIL

Preparing environment using Anaconda, same method for Windows and OSX:

  1. Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”

  2. Type in the following code in terminal:

     conda install -c conda-forge opencv
     conda install -c conda-forge numpy
     conda install -c conda-forge tensorflow
     conda install -c conda-forge pillow
    
  3. Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.

Overview

This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.

The Algorithm is composed of 2 parts:

1: Image Processing ( process.py , live.py )

2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

A Diagram of the Algorithm

Minimap
Minimap

Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)

[‘

[‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]

https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
.
I will keep updating the algorithm to support more champions and increase the accuracy :)

Required dependencies:

Opencv, Tensorflow, Numpy, PIL

Preparing environment using Anaconda, same method for Windows and OSX:

  1. Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
  • 2. Type in the following code in terminal:

    
    
        conda install -c conda-forge opencv
        conda install -c conda-forge numpy
        conda install -c conda-forge tensorflow
        conda install -c conda-forge pillow
    
  • Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.

  • Overview

    ) from this repository, and run liveidentify.py once you finished downloading.

    Overview

    This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.

    The Algorithm is composed of 2 parts:

    1: Image Processing ( process.py , live.py )

    2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

    process.py , live.py )

    2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

    Image Processing

    The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:

    1. split 3-d image into b,g,r channels
    1. use inRange function to binarize the b,g,r channels
    1. deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)
    1. Run HoughCircles function to detect the red circles in red channel
    1. Cut out squares based on coordinates of the circles and output them

    After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.

    Neural Network

    The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.

    The advantage to this approach is a small training dataset size and fast training. The over 20,000

    images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.

    A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)

    The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).

    style="max-width: 841.34375px;" viewBox="0 0 841.34375 446">
    Minimap
    Minimap

    Data V1.0.0
    As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)

    [‘

    [‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]

    https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
    .
    >

    Minimap
    Minimap

    Data V1.0.0
    As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)

    [‘

    [‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]

    https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
    .
    I will keep updating the algorithm to support more champions and increase the accuracy :)

    Required dependencies:

    Required dependencies:

    Opencv, Tensorflow, Numpy, PIL

    ```mermaid graph LR A[Minimap] --> B((OPENCV Image Processing)) B --> D[Champion A] B --> E[Champion B] B --> F[Champion C] B --> G[Champion D] B --> H[Champion E] D--> L{Neural Network} E --> L{Neural Network} F --> L{Neural Network} G --> L{Neural Network} H --> L{Neural Network} L --> Q[Riven] L --> R[Elise] L --> S[Ryze] L --> T[Kai'sa] L --> U[Alistar] ```>
    Minimap
    Minimap

    Data V1.0.0
    As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)

    [‘

    [‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]

    https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
    .
    >

    Minimap
    Minimap
    OPENCV Image Processing
    Champion A
    Champion A
    Champion B
    Champion B
    Champion C
    Champion D
    Champion D
    Champion E
    Champion E
    Neural Network
    Riven
    Riven
    Elise
    Elise
    Ryze
    Ryze
    Kai'sa
    Kai'sa
    Alistar
    Alistar

    Image Processing

    The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’s ring is detected using Opencv, whose process is as follows:

    1. split 3-d image into b,g,r channels

    2. use inRange function to binarize the b,g,r channels

    3. deduct b and g from red channel to isolate the red channel (the color of enemy champions’ rings)

    4. Run HoughCircles function to detect the red circles in red channel

    5. Cut out squares based on coordinates of the circles and output them

    After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.

    Neural Network

    The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’ portraits automatically.

    The advantage to this approach is a small training dataset size and fast training. The over 20,000
    images only took up 35MB of space when saved as “.npy” files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.

    A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as “researching” :)

    The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).

    # League Map Scanner (V 1.0.0)

    Data V1.0.0

    Data V1.0.0 As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)

    [‘

    ['ashe’', ‘'blitzcrank’', ‘'brand’', ‘'caitlyn’', ‘'cassiopeia’', ‘'darius’', ‘'drmundo’', ‘'ezreal’', ‘'fiddlestick’,’',' garen’', ‘'graves’', ‘'jax’', ‘'karthus’', ‘'kayle’', ‘'malphite’', ‘'nasus’', ‘'nidalee’', ‘'renekton’', ‘'ryze’', ‘'shen’,’',' sivir’', ‘'soraka’', ‘'tristana’', ‘'trundle’', ‘'udyr’', ‘'vladimir’', ‘'warwick’', ‘'wukong’', ‘'ziggs’', ‘'zilean’', ‘'zyra’]

    https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
    . I will keep updating the algorithm to support more champions and increase the accuracy :)

    Required dependencies:

    Required dependencies:

    Required dependencies:
    Opencv, Tensorflow, Numpy, PIL

    Preparing environment using Anaconda, same method for Windows and OSX:

    1. Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
  • 2. Type in the following code in terminal:

    
    
        conda install -c conda-forge opencv
        conda install -c conda-forge numpy
        conda install -c conda-forge tensorflow
        conda install -c conda-forge pillow
    
  • Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.

  • Overview

    ) from this repository, and run liveidentify.py once you finished downloading.

    Overview

    This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.

    The Algorithm is composed of 2 parts:

    1: Image Processing ( process.py , live.py )

    2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

    Image Processing

    The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:

    1. split 3-d image into b,g,r channels

    2. use inRange function to binarize the b,g,r channels

    3. deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)

    4. Run HoughCircles function to detect the red circles in red channel

    5. Cut out squares based on coordinates of the circles and output them

    After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.

    Neural Network

    The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.

    The advantage to this approach is a small training dataset size and fast training. The over 20,000

    images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.

    A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)

    The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).

    > B((OPENCV Image Processing)) B --> D[Champion A] B --> E[Champion B] B --> F[Champion C] B --> G[Champion D] B --> H[Champion E] D--> L{Neural Network} E --> L{Neural Network} F --> L{Neural Network} G --> L{Neural Network} H --> L{Neural Network} L --> Q[Riven] L --> R[Elise] L --> S[Ryze] L --> T[Kai'sa] L --> U[Alistar] ```

    Preparing environment using Anaconda, same method for Windows and OSX:

    1. Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
  • 2. Type in the following code in terminal:

  • conda install -c conda-forge opencv
    conda install -c conda-forge numpy
    conda install -c conda-forge tensorflow
    conda install -c conda-forge pillow
    conda install -c anaconda pil
    

    Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.

    Overview

    ) from this repository, and run liveidentify.py once you finished downloading.

    Overview

    This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.

    The Algorithm is composed of 2 parts:

    1: Image Processing ( process.py , live.py )

    2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

    Image Processing

    The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:

    1. split 3-d image into b,g,r channels

    2. use inRange function to binarize the b,g,r channels

    3. deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)

    4. Run HoughCircles function to detect the red circles in red channel

    5. Cut out squares based on coordinates of the circles and output them

    After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.

    Neural Network

    The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.

    The advantage to this approach is a small training dataset size and fast training. The over 20,000

    images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.

    A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)

    The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).

    Preparing environment using Anaconda, same method for Windows and OSX:

    1. Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”

    2. Type in the following code in terminal:

    conda install -c conda-forge opencv
    conda install -c conda-forge numpy
    conda install -c conda-forge tensorflow
    conda install -c conda-forge pillow
    conda install -c anaconda pil
    

    Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.

    Overview

    ) from this repository, and run liveidentify.py once you finished downloading.

    Overview

    This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.

    The Algorithm is composed of 2 parts:

    1: Image Processing ( process.py , live.py )

    2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

    Image Processing

    The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:

    1. split 3-d image into b,g,r channels

    2. use inRange function to binarize the b,g,r channels

    3. deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)

    4. Run HoughCircles function to detect the red circles in red channel

    5. Cut out squares based on coordinates of the circles and output them

    After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.

    Neural Network

    The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.

    The advantage to this approach is a small training dataset size and fast training. The over 20,000

    images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.

    A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)

    The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).

    ### Preparing environment using Anaconda, same method for Windows and OSX:
    1. Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”

    2. Type in the following code in terminal:

    conda install -c conda-forge opencv
    conda install -c conda-forge numpy
    conda install -c conda-forge tensorflow
    conda install -c conda-forge pillow
    conda install -c anaconda pil

    Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.

    Overview

    ) from this repository, and run liveidentify.py once you finished downloading.

    Overview

    This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.

    The Algorithm is composed of 2 parts:

    1: Image Processing ( process.py , live.py )

    2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )

    Image Processing

    The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:

    1. split 3-d image into b,g,r channels

    2. use inRange function to binarize the b,g,r channels

    3. deduct b and g from red channel to isolate the red channel (the color of enemy champions’' rings)

    4. Run HoughCircles function to detect the red circles in red channel

    5. Cut out squares based on coordinates of the circles and output them

    After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.

    Neural Network

    The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’' portraits automatically.

    The advantage to this approach is a small training dataset size and fast training. The over 20,000
    images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.

    A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’' practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as “"researching”" :)

    The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).

    About

    A Python program that utilizes CNN to identify enemy champions on the minimap

    Resources

    Stars

    Watchers

    Forks

    Packages

    No packages published

    Languages