Skip to content

Instantly share code, notes, and snippets.

View DuaneNielsen's full-sized avatar
👾
Happy!

Duane DuaneNielsen

👾
Happy!
View GitHub Profile
@tshanmukh
tshanmukh / ORB-visualize.py
Last active October 19, 2021 20:34
Implements a function to detect the keypoints using the ORB algorithm in opencv
# importing copy as we have to copy the same image to different instances to visualize
import copy
plt.rcParams['figure.figsize'] = [14.0, 7.0]
# Set the parameters of the ORB algorithm by specifying the maximum number of keypoints to locate and
# the pyramid decimation ratio
orb = cv2.ORB_create(200, 2.0) # refer the opencv page for available arguments and usages
# computing the keypoints using the detectandcompute method, this accepts a grey scale image and None parameter
# is to let the ORB know we are not using any mask
@diegopacheco
diegopacheco / latest-protobuf-ubuntu-18-04.md
Created June 7, 2018 20:13
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
@iandanforth
iandanforth / pymunk_cartpole.py
Created June 6, 2018 02:57
A port of the cart-pole OpenAI gym environment to Pymunk
"""
Classic cart-pole system.
Pymunk version by Ian Danforth
"""
import math
import gym
import pygame
import pymunk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikedh
mikedh / headless.py
Created December 15, 2017 19:20
Manual pyglet event loop headless rendering
import pyglet
import pyglet.gl as gl
import numpy as np
import os
import tempfile
import subprocess
import collections
@gboeing
gboeing / pypi.md
Last active June 17, 2022 16:11
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward