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.
Data consists of vertical Steam banners (library_600x900.jpg at 300x450 resolution).
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.
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.
- A feature extractor for Github repositories which include a
hubconf.pyfile. - Facebook's DINO:
- Facebook's DINOv2:
