Skip to content

Instantly share code, notes, and snippets.

View jackmead515's full-sized avatar
🤙
Working in paradise

Jack Mead jackmead515

🤙
Working in paradise
View GitHub Profile
@jackmead515
jackmead515 / gist:802dfe49489b63927beb9f373ab494b0
Created August 18, 2024 02:17
Convert To Detectron2 Compatability
import torch
import re
phmodel = torch.load("phenobench_mask_rcnn_r50_fpn.pt", map_location=torch.device('cpu'))
oldmodel = phmodel['model_state_dict']
newmodel = {}
for k in list(oldmodel.keys()):
@jackmead515
jackmead515 / gist:a1e1388154f3f3e99bdd2facba2d0b40
Created September 25, 2019 18:52
Bit Manipulation Stuff!
Bit Manipulation
& - and - both values are 1
| - or - one or the other is 1
^ - xor - if only one value is 1
~ - not - flips the bit