Skip to content

Instantly share code, notes, and snippets.

View isVoid's full-sized avatar
🤗

Michael Wang isVoid

🤗
View GitHub Profile
@isVoid
isVoid / dbg.hpp
Created July 1, 2019 23:47
A tiny local debug library for Leetcode. The second file is boilerplate code for vs code.
#include <iostream>
#include <stack>
#include <queue>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
import os
import subprocess
import random
def isVideo(f):
ext = f.split(".")[-1]
if ext == "mp4":
return True
return False
@echo off
for %%x in (*.ARW) do call :for_body %%x >> a7s.txt
exit /b
:for_body
echo %1
dcraw.exe -i -v %1 | findstr /i /B /c:"Camera Multip"
exit/b
import os
root = "F:\\Camera_Calibration\\A7S2\\16000"
for dirPath, _, files in os.walk(root):
for f in files:
# print (os.path.join(dirPath, f)[-22:])
print (f[9:-4])
try:
os.mkdir(os.path.join(root, f[9: -4]))
import os
import subprocess
import random
def isVideo(f):
ext = f.split(".")[-1]
if ext == "mp4":
return True
return False
@isVoid
isVoid / tf_data_augmentation_on_gpu.py
Created March 22, 2018 17:45 — forked from vertix/tf_data_augmentation_on_gpu.py
TF data augmentation on GPU
def augment(images, labels,
resize=None, # (width, height) tuple or None
horizontal_flip=False,
vertical_flip=False,
rotate=0, # Maximum rotation angle in degrees
crop_probability=0, # How often we do crops
crop_min_percent=0.6, # Minimum linear dimension of a crop
crop_max_percent=1., # Maximum linear dimension of a crop
mixup=0): # Mixup coeffecient, see https://arxiv.org/abs/1710.09412.pdf
if resize is not None:
@isVoid
isVoid / quickImport.jsx
Created January 22, 2018 02:37
Batch Timelapse Import, Comp and Queue.
app.project.bitsPerChannel = 16
myFootage = app.project.importFileWithDialog()[0]
footageName = myFootage.file.fsName
$.writeln(footageName)
var location = "B.M. Playa"
//var m = footageName.match(/\d{4}_\d{1,2}_\d{1,2}_.[^\\]*/gi)[0]
var n = footageName.match(/\d{1}_\d{2}_\d{4}/gi)[0]
$.writeln(location + n)
@isVoid
isVoid / char_rnn_tensorflow.py
Created January 3, 2018 09:26
Character level RNN tensorflow
import tensorflow as tf
import numpy as np
from tqdm import tqdm
class RNN(object):
def __init__(self, params):
self.params = params
def rnn_cell(self, x, ht0, hidden_size = 100, reuse = True):