Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / ESRGAN.md
Last active June 15, 2021 19:27
Google Colab: ESRGAN

Reference: https://github.com/xinntao/ESRGAN

Prepare code:

%cd /content
!git clone https://github.com/xinntao/ESRGAN.git

%cd /content/ESRGAN/models
!gdown --id 1TPrz5QKd8DHHt1k8SRtm6tMiPjz_Qene
@woctezuma
woctezuma / GPEN.md
Last active June 15, 2021 19:29
Google Colab: GPEN

Reference: https://github.com/yangxy/GPEN

Prepare code:

%pip install ninja

%cd /content
!git clone https://github.com/yangxy/GPEN.git

%cd /content/GPEN/weights
@woctezuma
woctezuma / fix_roguebook.py
Last active June 20, 2021 07:44
Fix Roguebook
# References:
# - https://gist.github.com/woctezuma/f4faef1210e49ed06cf4725bac60998f
# - https://steamcommunity.com/app/1076200/discussions/0/3070873501572457641/
from collections import Counter
from pathlib import Path
import glob
import os
@woctezuma
woctezuma / lego_save.reg
Created July 22, 2021 05:46
Save file for LEGO
REGEDIT4
[HKEY_CURRENT_USER\software\LEGO System A/S\Builder's Journey]
"SaveGame0_h1867918426"=hex:41,41,45,41,41,41,44,2F,2F,2F,2F,2F,41,51,41,41,\
41,41,41,41,41,41,41,4D,41,67,41,41,41,45,5A,42,63,33,4E,6C,62,57,4A,73,65,\
53,31,44,55,32,68,68,63,6E,41,73,49,46,5A,6C,63,6E,4E,70,62,32,34,39,4D,43,\
34,77,4C,6A,41,75,4D,43,77,67,51,33,56,73,64,48,56,79,5A,54,31,75,5A,58,56,\
30,63,6D,46,73,4C,43,42,51,64,57,4A,73,61,57,4E,4C,5A,58,6C,55,62,32,74,6C,\
62,6A,31,75,64,57,78,73,42,51,45,41,41,41,41,57,52,32,46,74,5A,56,42,79,5A,\
57,5A,7A,53,57,31,77,62,43,74,54,59,58,5A,6C,52,47,46,30,59,51,55,41,41,41,\
@woctezuma
woctezuma / compare_DINO.md
Last active October 2, 2021 12:39
Compare Facebook's DINO implementations: HugggingFace vs. official one
@woctezuma
woctezuma / vocabulary.md
Last active November 16, 2021 19:28
Vocabulary

Vocabulary

  • denoising diffusion probabilistic models (DDPM)
  • self-supervised learning (SSL)
  • vision transformers (ViT)
  • self-attention
  • masked language modeling, cf. BERT
  • contrastive instance discrimination
  • distillation
  • ablation study