Skip to content

Instantly share code, notes, and snippets.

View geohot's full-sized avatar

George Hotz geohot

View GitHub Profile
@geohot
geohot / tf_bundle.py
Created February 23, 2017 09:49
Really Low Quality Bundle Adjustment in Tensorflow
guess = np.concatenate([np.array(map(lambda x: np.array(x[:,3]).ravel(), rts)), fpts[:, 0:3]], axis=0)
selects = []
xys = []
for i, trk in enumerate(good_good_tracks):
for shot, kp in trk:
xy = G.node[(shot,kp)]['kp']/0.81412059
xys.append(xy)
select = np.zeros((len(frms)+len(good_good_tracks),))
select[shot] = 1
select[len(frms)+i] = 1
from keras.models import Sequential, Model
from keras.layers import Dense, Input, BatchNormalization as BN
input_img1 = Input(shape=(4,), name="input_img1")
vision_model = Sequential()
vision_model.add(Dense(4, input_shape=(4,)))
vision_model.add(BN(axis=1))
vision_model.add(Dense(4))
@geohot
geohot / extract.py
Last active July 18, 2022 05:13
extract imagenet ILSVRC2012 recursive tar
# extract ILSVRC2012 without killing your SSD
import tarfile
import os
import sys
def mkdir(x):
try:
os.makedirs(x)
except OSError, e: