Skip to content

Instantly share code, notes, and snippets.

View simgt's full-sized avatar

Simon simgt

  • Réunion, France
View GitHub Profile
@simgt
simgt / mobilenetv2.py
Created July 1, 2019 14:43
Mobilenetv2 embedding with output normalization
def conv_bn(inp, oup, stride):
return nn.Sequential(
nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
nn.BatchNorm2d(oup),
nn.ReLU6(inplace=True)
)
def conv_1x1_bn(inp, oup):
return nn.Sequential(
@simgt
simgt / cudamemorytracer.py
Created June 29, 2018 06:46
A simple Cuda memory tracer for PyTorch
import sys
from pathlib import Path
from functools import partial
from collections import defaultdict
import logging
import torch
logger = logging.getLogger(__name__)
@simgt
simgt / app.py
Last active June 15, 2018 07:51
A simple and pythonic video streaming server with OpenCV and Flask
import threading
import time
import flask
import cv2
class CameraThread(threading.Thread):
def __init__(self):
super().__init__()

Keybase proof

I hereby claim:

  • I am notsimon on github.
  • I am notsimon (https://keybase.io/notsimon) on keybase.
  • I have a public key ASDPurj1nGIr-lE381-_3Wk3Z6n2z9YbKjx2OK2_hYNImgo

To claim this, I am signing this object:

@simgt
simgt / split.py
Created October 10, 2017 08:48
A python script to split an image dataset
#! /usr/bin/env python3
import argparse
from pathlib import Path
from random import shuffle
import shutil
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
Split a dataset in two given a ratio.
local torch =require 'torch'
local nn =require 'nn'
local rnn =require 'rnn'
local gnuplot = require 'gnuplot'
torch.setnumthreads(4)
print('number of threads: ' .. torch.getnumthreads())
batchSize = 16
rho = 16 -- sequence length
@simgt
simgt / message.hpp
Created April 14, 2016 14:11
Flatbuffers, Boost.Asio, TCP
#pragma once
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
namespace net {
@simgt
simgt / Makefile
Last active August 29, 2015 14:19
Vietnamese Maze
maze : maze.o
gcc $^ -o $@
%.o : %.c
gcc -std=c99 -Wall -Werror $^ -c -o $@
" Night Garden
" Author: Simon Guillot <[first name].[last name]@epita.fr>
" Note: Based on the Tomorrow-Night-Eighties theme
hi clear
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
@simgt
simgt / ndarray
Last active August 29, 2015 13:58
N-dimensional preprocessor helpers for C and templated type for C++
The C implementation is rather more complex than the C++ version.