Skip to content

Instantly share code, notes, and snippets.

View HTLife's full-sized avatar

Jacky Liu HTLife

  • National Chung Cheng University
  • Tokyo, Japan
View GitHub Profile
@HTLife
HTLife / convert_kitti_bin_to_pcd.py
Created February 11, 2019 11:46
Convert KITTI velodyne bin to open3d pcd
import numpy as np
import struct
from open3d import *
def convert_kitti_bin_to_pcd(binFilePath):
size_float = 4
list_pcd = []
with open(binFilePath, "rb") as f:
byte = f.read(size_float * 4)
while byte:
<!DOCTYPE html>
<meta charset="utf-8">
<style>
form {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
position: absolute;
left: 10px;
top: 10px;
}
[formats]
version=1.0
data\normal\priority=-1
data\normal\bold=false
data\normal\italic=false
data\normal\overline=false
data\normal\underline=false
data\normal\strikeout=false
data\normal\waveUnderline=false
data\normal\foreground=#f8f8f2
@HTLife
HTLife / ga.R
Created May 8, 2018 04:12
GA with R
#R version 3.3.2
set.seed(10)
N_size = 20
N_bit = 8
Gen = 50
mut_freq = 0.1
Population = matrix(sample(c(0,1), size=N_size*N_bit, replace=TRUE), N_size, N_bit)
@HTLife
HTLife / install.sh
Created May 7, 2018 14:25
tmux mouse mode installation script
git clone https://github.com/nhdaly/tmux-better-mouse-mode ~/.tmux
echo 'set-option -g mouse on' >> ~/.tmux.conf
echo 'run-shell ~/.tmux/scroll_copy_mode.tmux' >> ~/.tmux.conf
tmux source-file ~/.tmux.conf
@HTLife
HTLife / .tmux.conf
Created April 17, 2018 06:55
tmux conf
Put this at the bottom of .tmux.conf:
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
@HTLife
HTLife / cnn_lstm.py
Last active March 25, 2018 13:57
MNIST CNNs + LSTM
# pytorch mnist cnn + lstm
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
@HTLife
HTLife / cnn_lstm.py
Last active April 8, 2021 05:00
Time distributed CNNs + LSTM in Keras
def defModel():
model = Sequential()
#Izda.add(TimeDistributed(
# Convolution2D(40,3,3,border_mode='same'), input_shape=(sequence_lengths, 1,8,10)))
model.add(
TimeDistributed(
Conv2D(32, (7, 7), padding='same', strides = 2),
input_shape=(None, 540, 960, 2)))
model.add(Activation('relu'))
@HTLife
HTLife / summary.py
Created March 16, 2018 06:37
Pytorch model summary
def summary(input_size, model):
def register_hook(module):
def hook(module, input, output):
class_name = str(module.__class__).split('.')[-1].split("'")[0]
module_idx = len(summary)
m_key = '%s-%i' % (class_name, module_idx+1)
summary[m_key] = OrderedDict()
summary[m_key]['input_shape'] = list(input[0].size())
summary[m_key]['input_shape'][0] = -1
@HTLife
HTLife / 樣式(適用所有卡片)
Created February 26, 2018 04:03
Anki card template
.frontbg {
background-color: #53cd80;
border-radius: 7px;
color: #fff;
position: relative;
left: 0;
}
.android .frontbg {
background-color: #eelf34;
border-radius: 7px;