Skip to content

Instantly share code, notes, and snippets.

@woctezuma
woctezuma / sample.py
Created December 29, 2021 19:27 — forked from ToutinRoger/sample.mjs
Sample request for a GraphQL Query
# Import the requests module as it allows
# us to request to the api.
import requests
# NOTE: This is for requesting a GraphQL response
# without any authorization (bearer token | access_token)
# The GraphQL url to request which can be:
# - https://graphql.epicgames.com/graphql [Main Site]
# - https://epicgames.com/graphql [Counter Part Of Main Site]
@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()

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")