Skip to content

Instantly share code, notes, and snippets.

item {
name: "/m/01g317"
id: 1
display_name: "person"
keypoints {
id: 0
label: "left_ankle"
}
keypoints {
id: 1
@habakan
habakan / partial-staking.ipynb
Created February 4, 2022 12:59
Partial Staking.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habakan
habakan / pls-pcr.ipynb
Last active June 10, 2021 05:14
PLS, PCR.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habakan
habakan / convert_to_tfrecord.py
Last active January 8, 2021 11:48
convert_to_tfrecord.py
import os
import io
import glob
import hashlib
import pandas as pd
import xml.etree.ElementTree as ET
import tensorflow.compat.v1 as tf
import random
from PIL import Image
@habakan
habakan / create_tf_record.py
Last active January 8, 2021 11:05
create_tf_record.py
import hashlib
import os
import random
import logging
from pathlib import Path
from lxml import etree
import tensorflow as tf
from object_detection.utils import dataset_util, label_map_util
@habakan
habakan / subtract_background.py
Created December 12, 2019 13:50
subtract_background
import cv2
def main():
cap = cv2.VideoCapture(0)
bgObj = cv2.bgsegm.createBackgroundSubtractorMOG()
while(True):
ret, frame = cap.read()
fgmask = bgObj.apply(frame)
@habakan
habakan / ReLU_Property.ipynb
Created September 19, 2019 04:01
ReLU_Property
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
DIRPATH=$1
outpath="output/"
for path in $DIRPATH*; do
name=`basename $path`
bro -r $path ./tcpdump2gureKDDCup99/darpa2gurekddcup.bro > conn.list -C
sort -n conn.list > conn_sort.list
./tcpdump2gureKDDCup99/trafAld.out conn_sort.list
mv conn_sort.list $outpath$name".csv"
@habakan
habakan / setup.sh
Last active June 2, 2018 20:24
ubuntu-pyenv-setup
#/bin/bash
sudo apt-get install git gcc make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev
cd /usr/local/
sudo git clone git://github.com/yyuu/pyenv.git ./pyenv
sudo mkdir -p ./pyenv/versions ./pyenv/shims
echo 'export PYENV_ROOT="/usr/local/pyenv"' | sudo tee -a /etc/profile.d/pyenv.sh
echo 'export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"' | sudo tee -a /etc/profile.d/pyenv.sh
@habakan
habakan / mnist_tensorflow.py
Created February 14, 2018 07:31
mnist_tensorflow
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIAT_data/", one_hot=True)
import tensorflow as tf
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.nn.softmax(tf.matmul(x, W) + b)
y_ = tf.placeholder(tf.float32, [None, 10])