Skip to content

Instantly share code, notes, and snippets.

View noirmist's full-sized avatar

Jungwoo noirmist

  • HCI Lab
  • Seoul.KR
View GitHub Profile
@BloodAxe
BloodAxe / eggs_detector.cpp
Created July 15, 2014 14:37
Image enchancement and Hough transform example
/**
* @brief Image enchancement and Hough transform example
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @copyright computer-vision-talks.com/articles/how-to-detect-circles-in-noisy-image/
*/
#include <opencv2/opencv.hpp>
@erogol
erogol / maxout_layer
Created January 19, 2015 14:03
maxout layer implementation for caffe library
layers {
name: "conv1A"
type: CONVOLUTION
bottom: "data"
top: "conv1A"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
from torch import *
import torch.nn.functional as F
import torch.nn as nn
class RNNModel(nn.Module):
"""
Neural Network Module with an embedding layer, a recurent module and an output linear layer
Arguments:
rnn_type(str) -- type of rnn module to use options are ['LSTM', 'GRU', 'RNN_TANH', 'RNN_RELU']
@noirmist
noirmist / collate.py
Created March 5, 2019 04:44 — forked from rkaplan/collate.py
PyTorch example of a custom collate function that uses shared memory when appropriate
import functools
def my_collate(batch, use_shared_memory=False):
r"""Puts each data field into a tensor with outer dimension batch size"""
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}"
elem_type = type(batch[0])
if isinstance(batch[0], torch.Tensor):
out = None
if use_shared_memory:
@rkaplan
rkaplan / collate.py
Last active June 4, 2020 00:54
PyTorch example of a custom collate function that uses shared memory when appropriate
import functools
def my_collate(batch, use_shared_memory=False):
r"""Puts each data field into a tensor with outer dimension batch size"""
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}"
elem_type = type(batch[0])
if isinstance(batch[0], torch.Tensor):
out = None
if use_shared_memory:
@Musinux
Musinux / install-packages.sh
Last active March 29, 2021 12:49
VNC xstartup for unity WARNING ! THIS WAS WRITTEN A LONG TIME AGO (2018), IT MAY NOT BE RELEVANT ANYMORE
#!/bin/bash
# WARNING ! THIS WAS WRITTEN A LONG TIME AGO (2018), IT MAY NOT BE RELEVANT ANYMORE
sudo apt-get install vnc4server ubuntu-desktop
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
@stonehippo
stonehippo / docker_x11_gui_osx.md
Last active December 6, 2021 00:21
Getting X11 GUI applications to work on OS X with Docker

Getting X11 GUI applications to work on OS X with Docker

$ brew install socat
$ brew cask install xquartz <--- assuming you don't already have XQuartz installed some other way
$ open -a XQuartz <--- start an XQuartz session

$ socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
@Sitin
Sitin / install.sh
Last active February 1, 2022 19:35
Install Autodesk's Python FBX SDK for Homebrew Python 2.7 & 3.x
function link_fbx_sdk() {
INTERPRETER=$1
SITE_PACKAGES=`$INTERPRETER -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
PYTHON_LIB="${2}"
echo "[Installing] '$PYTHON_LIB' to '$SITE_PACKAGES'"
pushd $SITE_PACKAGES
for file in "${PYTHON_LIB}"/*
do
VGG_ILSVRC_19_layers_train_val.prototxt
name: "VGG_ILSVRC_19_layers"
layers {
name: "data"
type: DATA
include {
phase: TRAIN
}
transform_param {
crop_size: 224
@tonmoay
tonmoay / cvimg.py
Created December 20, 2016 05:18
Template matching using OpenCV python. This code gets a real time frame from webcam & matches with faces in 'images' folder. After the lookup, it rectangles the webcam face & says with which face the webcam face matches
import cv2
from matplotlib import pyplot as plt
import numpy as np
cap = cv2.VideoCapture(0) #Webcam Capture
while(True):
ret, frame = cap.read()