woctezuma / download-steam-banners

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Download Steam Banners

Build status Code coverage Code Quality

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

Similar banners with cosine similarity and average pooling

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

On Windows, the most recent version of OpenCV can also be downloaded from this repository. To install it:

pip install opencv_python-4.0.1-cp36-cp36m-win_amd64.whl

Data

A data snapshot from February 2019 is available in download-steam-banners-data/.

Otherwise, you would have to:

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

Alternatively, run this IPython notebook. Open In Colab A list of of appIDs (tied to games) is first downloaded via SteamSpy API. Then banner URLs are directly inferred from appIDs, without relying on app details.

Usage

Store banners are resized to 128x128 with batch_resize_images.py.

To retrieve Steam games with similar store banners, 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 or Minkowski distance with retrieve_similar_features.py.

Alternatively:

  • image hashes could be computed with build_search_index.py and retrieve_similar_banners.py,
  • different image features could be computed, e.g. ORB descriptors with build_feature_index.py and retrieve_similar_features.py.

Caveat

Fill-in the path to steam-api/data/appdetails/ in download_steam_banners.py. If you use PyCharm on Windows, you could just mention your Windows username as follows:

def get_user_name():
    user_name = 'Woctezuma' # <--- here
    return user_name

Results

Similar games

Results obtained with a neural net (MobileNet) are shown on the Wiki.

Results obtained with alternative methods are not shown:

  • image hashes are mostly useful to detect duplicates,
  • ORB descriptors seem less relevant than the features obtained with MobileNet.

An in-depth commentary is provided on the Wiki. Overall, I would suggest to match features with:

  • cosine similarity, to avoid having to deal with weird matches of feature vectors with a norm close to zero,
  • either concatenation or average pooling: with concatenation, the banner layout greatly constrains the matching.

Unique games

It is possible to highlight games with unique store banners, 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 banners, with MobileNet v1.

License:MIT License


Languages

Language:Python 100.0%