Skip to content

Instantly share code, notes, and snippets.

import cv2
#from scipy.ndimage import gaussian_filter, uniform_filter
from cupyx.scipy.ndimage import gaussian_filter, uniform_filter
#import numpy as np
import cupy as np # don't laugh
# inspired by https://www.youtube.com/watch?v=X-iSQQgOd1A
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import atexit
import time
import subprocess
from io import BytesIO
import PIL.Image
import numpy as np
from matplotlib import pyplot as plt
@soravux
soravux / Design 3 -- Simulateur Robot.ipynb
Created February 4, 2018 21:35
Simulateur du robot de GEL-3014 / GLO-3013
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from scipy.misc import imread, imsave
from matplotlib import pyplot as plt
# Get a linear version of the images
target_im = (imread("lighting_gt.png").astype('float32') / 255.)**2.2 # Poor man un-sRGB
source_im = (imread("warped_0150.png").astype('float32') / 255.)**2.2
@soravux
soravux / adversarial_stability.py
Last active September 26, 2017 04:03
Test pour la stabilité des exemples adversariaux.
from __future__ import print_function
import os
from tqdm import tqdm
import numpy as np
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
#!/usr/bin/env python3
VERSION = "v0.2.0"
"""
Copyright (c) 2013 devunt
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
import sys
import csv
import numpy as np
from scipy.misc import imread
output_file = 'sharpnesses.txt'
imgs = sys.argv[1:]
@soravux
soravux / resizeimage.py
Created March 3, 2017 20:16
ResizeImage layer
import tensorflow as tf
# To use : model.add(ResizeImage(<an input shape>))
# e.g.: model.add(ResizeImage(model.layers[0].output_shape[1:3]))
class ResizeImage(Layer):
def __init__(self, output_dim, **kwargs):
self.output_dim = output_dim
super().__init__(**kwargs)

Adding a bunny lit with an environment map to a background using Blender's Cycles renderer.