woctezuma / download-steam-screenshots

Retrieve Steam games with similar store screenshots, with MobileNet v1.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Download Steam Screenshots

Build status Code coverage Code Quality

This repository contains Python code to retrieve Steam games with similar store screenshots.

Similar screenshots

Requirements

  • Install the latest version of Python 3.X. For CNTK, you will need Python 3.6.
  • Install the required packages:
pip install -r requirements.txt

Data

A data snapshot from April 2019 is available in download-steam-screenshots-data/.

Otherwise, you would have to:

  1. download app details with steam-api,
  2. parse app details to find the sceenshot URL of each game,
  3. download the screenshots with download_steam_banners.py.

Usage

Store screenshots are first center-cropped and then resized to 128x128 with batch_resize_images.py.

To retrieve Steam games with similar store screenshots, image features are:

  1. extracted by a neural net with build_feature_index.py,
  2. either concatenated, or merged via a pooling process (average or maximum pooling),
  3. compared based on cosine similarity with retrieve_similar_features.py.

Caveat

To avoid messing features for banners and screenshots, edit the code in download-steam-banners as follows.

Edit build_feature_index.py

Ensure get_features_folder_name() does not point to the output folder already used for banners.

def get_features_folder_name():
    features_folder_name = 'features_for_screenshots/' # <--- here
    pathlib.Path(features_folder_name).mkdir(exist_ok=True)
    return features_folder_name

Ensure build_feature_index() is called with argument:

  • data_folder pointing to the input folder for screenshots.
if __name__ == '__main__':
    build_feature_index(save_keras_output=True,
                        include_top=False,
                        data_folder='128x128/') # <--- here

Edit retrieve_similar_features.py

Ensure batch_retrieve_similar_features() is called with arguments:

  • data_folder as above,
  • images_are_store_banners=False.
if __name__ == '__main__':
    for pooling in [None, 'max', 'avg']:
        batch_retrieve_similar_features(pooling,
                                        data_folder='128x128/', # <--- here
                                        images_are_store_banners=False) # <--- here

Results

Similar games

Results are shown on the Wiki.

An in-depth commentary is provided on the Wiki.

Unique games

It is possible to highlight games with unique store screenshots, by applying a threshold to similarity values output by the algorithm. This is done in find_unique_games.py:

  • cosine similarity is used to compare features,
  • a game is unique if the similarity score between a query game and its most similar game (other than itself) is lower than or equal to an arbitrary threshold.

Results are shown here.

References

About

Retrieve Steam games with similar store screenshots, with MobileNet v1.

License:MIT License


Languages

Language:Python 100.0%