Skip to content

Instantly share code, notes, and snippets.

@woctezuma
woctezuma / hidden_gems_using_players.md
Last active April 17, 2024 15:06
Hidden Gems, using players total (forever) as a popularity measure

This post contains a ranking of Steam games, based on a score intended to favor "hidden gems". A "hidden gem" is defined as a high-quality game (hence the "gem") which only got little attention (hence "hidden"). Therefore, the score of a game is defined as the product of a quality measure (its Wilson score) and a decreasing function of a popularity measure (its players total forever). The quality measure comes from SteamDB and the popularity measure comes from SteamSpy API. Finally, here is a reference to the NeoGAF post explaining the method, and the NeoGAF post explaining the idea behind the optimization of the only free parameter. The Python source code can be found on Github.

Reproducibility

To reproduce the results, use data downloaded betwe

@woctezuma
woctezuma / hidden_gems_using_playtime.md
Last active December 21, 2020 20:01
Hiddem Gems, using median playtime (forever) as a popularity measure

PC Gamer

If you arrived here from a PC Gamer article, I suggest you check the Python source code and one of these rankings:

  • original ranking, featured on PC Gamer, based on data downloaded prior to the Steam summer sales.
  • updated ranking, using data from June 30, a week after the Steam summer sales have started.

Bug fix regarding ranking based on playtime

Initially, I presented on this Gist page a ranking using playtime as popularity measure. However, as I have kept working on the code, I have found out this ranking likely suffered from a bug. The bug, which is now fixed, resulted in a ranking very similar to the ranking using players total as popularity measure. Thankfully, the ranking featured in the PC Gamer article is bug-free sinc

@woctezuma
woctezuma / hidden_gems_using_players_a_week_into_summer_sales.md
Last active September 12, 2022 21:40
Hidden Gems, using players total (forever) as a popularity measure, one week after the Steam summer sales have started.

This post contains a ranking of Steam games, based on a score intended to favor "hidden gems". It is a follow-up of a previous ranking, one week after the Steam summer sales have started. The Python source code can be found on Github.

Reproducibility

To reproduce the results, use data downloaded on June 30 with alpha ~ 10^(6.24), which arises from an optimization with 1 example of "hidden gem":

  • Contradiction - the all-video murder mystery adventure (appID=373390)

Ranking of Steam games favoring hidden gems

  1. Wuppo
  2. fault - milestone two side:above
@woctezuma
woctezuma / how_to_pypi.md
Last active May 3, 2023 22:40
My PyPI Release How To
pip install bumpversion setuptools wheel twine

bumpversion --current-version 0.4.0 minor setup.py
git add setup.cfg setup.py
git commit -m "Bump version to v0.5.0"

git tag "0.5.0"
git push --tags
git push

Get pretrained weights:

wget https://dl.fbaipublicfiles.com/detr/detr-r50-e632da11.pth

Remove class weights

checkpoint = torch.load("detr-r50-e632da11.pth", map_location='cpu')
del checkpoint["model"]["class_embed.weight"]
del checkpoint["model"]["class_embed.bias"]
torch.save(checkpoint,"detr-r50_no-class-head.pth")
@woctezuma
woctezuma / steamspy.py
Last active July 15, 2023 20:25
Respect rate-limits of SteamSpy API
import json
import time
from pathlib import Path
import steamspypi
def get_cooldown():
cooldown = 70 # 1 minute plus a cushion
@woctezuma
woctezuma / block_inactive_followers.py
Created August 24, 2020 08:18
Remove inactive followers on SensCritique
import requests
from bs4 import BeautifulSoup
def get_my_secret_cookie():
my_secret_cookie = {
"SC_AUTH_UID": "30993",
"SC_DEVICE_CATEGORY": "desktop",
"SC_AUTH": "MY_SECRET_COOKIE", # TODO
@woctezuma
woctezuma / age.py
Created September 7, 2020 21:48 — forked from rolux/age.py
# 1. Set up StyleGAN
import dnnlib
import dnnlib.tflib as tflib
import pretrained_networks
network_pkl = 'gdrive:networks/stylegan2-ffhq-config-f.pkl'
_G, _D, Gs = pretrained_networks.load_networks(network_pkl)
Gs_kwargs = dnnlib.EasyDict()
@woctezuma
woctezuma / stylegan2_usage.py
Created September 21, 2020 16:13
StyleGAN2: minimal usage
import pretrained_networks
import numpy as np
import dnnlib
import dnnlib.tflib as tflib
import PIL.Image
network_pkl = 'gdrive:networks/stylegan2-ffhq-config-f.pkl'
_, _, Gs = pretrained_networks.load_networks(network_pkl)
rng_seed = 5616
@woctezuma
woctezuma / PSFRGAN.md
Last active January 17, 2022 14:26
Google Colab: PSFRGAN

Reference: https://github.com/chaofengc/PSFR-GAN

Prepare code:

%cd /content
!git clone https://github.com/chaofengc/PSFR-GAN.git

%mkdir -p /content/PSFR-GAN/pretrain_models
%cd /content/PSFR-GAN/pretrain_models
!gdown --id 1UhzMSORSul88iVfSYQYuEal83lEoNN7l