Skip to content

Instantly share code, notes, and snippets.

View etienne87's full-sized avatar
🐶
Working from home

etienne87

🐶
Working from home
View GitHub Profile
@etienne87
etienne87 / tf_bilateral_rgb.py
Created March 23, 2018 17:03
tf_bilateral_rgb.py
#!/usr/bin/python
# torch_bilateral: bi/trilateral filtering in tf
# Copyright: (c) 2017-2018 Prophesee
from __future__ import print_function
import tensorflow as tf
import numpy as np
import pdb
import time
@etienne87
etienne87 / torch_bilateral_rgb.py
Last active March 25, 2018 21:11
torch bilateral rgb
#!/usr/bin/python
# torch_bilateral: bi/trilateral filtering in torch
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn import Parameter
import numpy as np
import pdb
import time
#!/usr/bin/python
# This script runs a random 3d animation & can retrieve:
# - detection
# - flow
# - zbuffer
#
# Copyright: (c) 2017-2018 Chronocam
import numpy as np
import cv2
@etienne87
etienne87 / timing_utils.py
Created May 14, 2019 10:26
timing_utils.py
from __future__ import division
import time
import numpy as np
class Timing:
def __init__(self):
self.total = 0
self.ncalls = 0
self.nevents = 0
self.last_num = -1
@etienne87
etienne87 / conv_rnn_test.py
Last active June 14, 2019 13:30
conv_rnn_test.py
# pylint: disable-all
import torch.nn as nn
from torch.nn import functional as F
import torch
def time_to_batch(x):
t, n = x.size()[:2]
x = x.view(n * t, *x.size()[2:])
return x, n
@etienne87
etienne87 / conv_rnn_modules.py
Last active June 14, 2019 15:29
conv_rnn_modules.py
# pylint: disable-all
import torch.nn as nn
from torch.nn import functional as F
import torch
def time_to_batch(x):
t, n = x.size()[:2]
x = x.view(n * t, *x.size()[2:])
return x, n
@etienne87
etienne87 / image_stitching.py
Last active June 23, 2019 10:17
image stitching experiment
from __future__ import print_function
import numpy as np
import imutils
import cv2
"""
Homecooked RANSAC, we will see if we manage to replace cv2.findHomography(..., cv2.RANSAC)
"""
def ransac(data, model, n, k, t, d):
bestfit = None
@etienne87
etienne87 / draw_mickey.py
Created June 29, 2019 20:33
trying to draw mickey using binary cross entropy
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
import random
def bce_loss_with_logits(x, y):
@etienne87
etienne87 / viz_ts.py
Created July 4, 2019 07:52
viz_ts.py
from __future__ import print_function
import time
import numpy as np
import cv2
from prophesee_utils.td_video import ChronoVideo
if __name__ == '__main__':
delay = 1
base_delay = 1
stop = False
@etienne87
etienne87 / world_to_camera_and_back.py
Last active August 1, 2019 09:04
world_to_camera_and_back
#!/usr/bin/python
from __future__ import print_function
"""
* World To Camera & Back (projective equations of pinhole cameras) *
* -------------------- *
* The OpenCV reference frame: *
* (or sometimes called "Camera Reference Frame"): *
* Z points towards the direction of forward motion of the camera *
* X points right wrt Y *