Skip to content

Instantly share code, notes, and snippets.

View brotherofken's full-sized avatar

Rasim Akhunzyanov brotherofken

  • Yandex Self-Driving Group
  • Moscow, Russia
View GitHub Profile
@brotherofken
brotherofken / self.md
Created October 19, 2020 20:42 — forked from diorahman/self.md
CUDA Books: Self taught
@brotherofken
brotherofken / faceswap.filter.diff
Created June 29, 2020 20:40
Changes that make face filter working
diff --git a/lib/face_filter.py b/lib/face_filter.py
index 096709d..cb4a10f 100644
--- a/lib/face_filter.py
+++ b/lib/face_filter.py
@@ -5,7 +5,7 @@ import logging
from lib.vgg_face import VGGFace
from lib.image import read_image
-from plugins.extract.pipeline import Extractor
+from plugins.extract.pipeline import Extractor, ExtractMedia
extern "C" int runOpenCV(halide_buffer_t *im1, halide_buffer_t *im2, halide_buffer_t *im3, halide_buffer_t *out) {
// width
const int min0 = out->dim[0].min;
const int max0 = out->dim[0].min + out->dim[0].extent - 1;
const int width = out->dim[0].extent;
// height
const int min1 = out->dim[1].min;
const int max1 = out->dim[1].min + out->dim[1].extent - 1;
const int height = out->dim[1].extent;
@InProceedings{Campbell_2017_ICCV,
author = {Campbell, Dylan and Petersson, Lars and Kneip, Laurent and Li, Hongdong},
title = {Globally-Optimal Inlier Set Maximisation for Simultaneous Camera Pose and Feature Correspondence},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
month = {Oct},
year = {2017}
}
@InProceedings{Huang_2017_ICCV,
author = {Huang, Chao-Tsung},
title = {Robust Pseudo Random Fields for Light-Field Stereo Matching},
# In[]
import SimpleITK as sitk
import vtk
import numpy as np
import scipy as sp
from scipy.stats.mstats import mquantiles
import sys
from vtk.util.vtkConstants import *
# In[]
import gym
import numpy as np
np.set_printoptions(precision=3, suppress=True)
# In[]
def p_pp(policy):
mapping = {
0: '<',
@brotherofken
brotherofken / qlearning.py
Last active December 30, 2016 22:20
First attempt to implement qlearning using function approximation. Mountain car environment.
# In[]
import gym
import numpy as np
import theano
import theano.tensor as T
import lasagne
import sklearn.preprocessing
np.set_printoptions(precision=2)
# In[]
import collections
import gym
import numpy as np
import math
# In[]
class DiscretePolicy(object):
# In[]
class DiscretePolicy(object):
def __init__(self, env):
if not issubclass(type(env), gym.envs.toy_text.discrete.DiscreteEnv):
raise Exception('env should be subclass of gym.envs.toy_text.'
'discrete.DiscreteEnv')
self.env = env
self.policy = np.array([env.action_space.sample() for i in
range(self.env.nS)],
dtype=int)
@brotherofken
brotherofken / agent_mdp_iteration.py
Created October 9, 2016 12:09
Solving MSPs using value and policy iteraton
# In[]
import collections
import gym
import numpy as np
import math
# In[]
class IterationAgent(object):