Skip to content

565655w/steam-DINOv2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Steam DINOv2: match banners with Meta AI's DINOv2

This repository contains Python code to retrieve Steam games with similar store banners, using Meta AI's DINOv2.

Image similarity is assessed by the cosine similarity between image features encoded by DINOv2.

Similar vertical banners

Data

Data consists of vertical Steam banners (library_600x900.jpg at 300x450 resolution).

Pre-processing

DINOv2 follows torchvision's pre-processing pipeline for classification:

  • resize to 256 resolution, i.e. the smallest edge of the image will match this number,
  • center-crop at 224 resolution, i.e. a square crop is made,
  • normalize intensity.
transforms_list = [
    transforms.Resize(resize_size, interpolation=interpolation),
    transforms.CenterCrop(crop_size),
    MaybeToTensor(),
    make_normalize_transform(mean=mean, std=std),
]

Therefore, downloaded images can be resized to 256x384 resolution before being stored to disk.

As discussed in this Github issue, the crop of DINOv2 can be made less agressive by resizing to 224 instead of 256 resolution. In this case, downloaded images can be resized to 224x336 resolution before being stored to disk.

Snapshot

A snapshot of image data was downloaded on July 20, 2023 and stored as a Github release.

If you wish to re-create this data snapshot, run download_steam_images.ipynb. Open In Colab

References

About

Retrieve Steam games with similar store banners, with Facebook's DINOv2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%