Skip to content

Instantly share code, notes, and snippets.

View zeyuyun1's full-sized avatar

Zeyu Yun zeyuyun1

  • UC Berkeley
  • Berkeley
View GitHub Profile
#!/usr/bin/env python3
import numpy as np
import gym
from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv
env_name = 'Pendulum-v0'
nproc = 8
T = 10
@pjessesco
pjessesco / image_viewer.py
Created February 15, 2021 08:28
Python full-screen image viewer using PyQT5, without white board which appears in `cv2.imshow()`
# Reference : https://stackoverflow.com/a/59539843
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import QObject, pyqtSignal
import sys
import time
import threading
@daleroberts
daleroberts / kde.png
Last active August 12, 2022 17:15
Two-dimensional kernel density estimate: comparing scikit-learn and scipy
kde.png
@anastasiia-kornilova
anastasiia-kornilova / gaussFilter1d.java
Created July 15, 2018 16:13
This is the simplest implementation of gaussian_filter1d from Python scipy library.
import static java.lang.Math.*;
public class GaussSmooth {
private static double gauss(double sigma, double x) {
double expVal = -0.5 * (pow(x, 2) / pow(sigma, 2));
return exp(expVal);
}
private static double[] gaussKernel1d(double sigma, int lw) {
import torch
import torch.nn.functional as F
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torch.utils.data import DataLoader
from torch_geometric.utils import grid
from torch_geometric.nn import SplineConv
train_dataset = MNIST('/tmp/MNIST', train=True, transform=ToTensor())
@tehmas
tehmas / client.py
Created December 4, 2016 16:55
Sending OpenCV frames using Python TCP sockets
import cv2
import cPickle
import socket
import struct
TCP_IP = '127.0.0.1'
TCP_PORT = 9501
server_address = (TCP_IP, TCP_PORT)
i = 0
@andrewgiessel
andrewgiessel / gist:4635563
Last active June 30, 2023 20:31
simple numpy based 2d gaussian function
import numpy as np
def makeGaussian(size, fwhm = 3, center=None):
""" Make a square gaussian kernel.
size is the length of a side of the square
fwhm is full-width-half-maximum, which
can be thought of as an effective radius.
"""
@bsdnoobz
bsdnoobz / read-camera.py
Last active December 22, 2023 18:20
Displaying webcam feed using OpenCV and Python+PySide.
#!/usr/bin/env python
from PySide.QtCore import *
from PySide.QtGui import *
import cv2
import sys
class MainApp(QWidget):
def __init__(self):
@nirshlezinger1
nirshlezinger1 / lista-vs-ista.ipynb
Created May 4, 2022 07:58
LISTA vs ISTA.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.