Skip to content

Instantly share code, notes, and snippets.

View zeyuyun1's full-sized avatar

Zeyu Yun zeyuyun1

  • UC Berkeley
  • Berkeley
View GitHub Profile
@sgraaf
sgraaf / ddp_example.py
Last active April 23, 2024 11:13
PyTorch Distributed Data Parallel (DDP) example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.distributed import DistributedSampler
from transformers import BertForMaskedLM
@jin-zhe
jin-zhe / actionrecognitiondatasets.md
Last active March 18, 2024 23:47
An overview of action recognition datasets and their detection classes

Activity Recognition Datasets

An overview of recent action recognition datasets and their detection classes

Concepts & terminologies:

  • Action: Atomic low-level movement such as standing up, sitting down, walking, talking etc.
  • Activity/event: Higher level occurence then actions such as dining, playing, dancing
  • Trimmed video: A short video clip containing event/action/activity of interest
  • Untrimmed video: A video clip of arbitrary length potentially containing durations without activities of interest
  • Localization: locating an instance of event/action/activity within a video at a spatial or temporal scale
  • Spatial localization: Locating the region/area of an instance of action/activity within a video
@arose13
arose13 / install-conda.sh
Last active February 18, 2024 12:20
Install Miniconda in Ubuntu
# Setup Ubuntu
sudo apt update --yes
sudo apt upgrade --yes
# Get Miniconda and make it the main Python interpreter
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
rm ~/miniconda.sh
export PATH=~/miniconda/bin:$PATH
@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.
@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):
@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.
"""
@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
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())
@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) {