Skip to content

Instantly share code, notes, and snippets.

View jinyu121's full-sized avatar
💪
Fighting!

Yu Hao jinyu121

💪
Fighting!
View GitHub Profile
@jinyu121
jinyu121 / png1_to_png3.py
Last active March 29, 2017 11:33
深度数据一维png转为三维png
import re
import os
import skimage.io as io
import skimage.color as color
import numpy as np
rootdir_from = "/home/haoyu/depth_png"
rootdir_to = "/home/haoyu/depth_png3"
pattern_ith = re.compile(r"\((\d+)\)")
@jinyu121
jinyu121 / rename.py
Created March 29, 2017 11:37
将杂乱无章的文件重命名
import re
import os.path
rootdir = "/home/haoyu/pictures"
fn_ext = ".png"
pattern_ith = re.compile(r"\((\d+)\)")
for parent, dirnames, filenames in os.walk(rootdir):
for filename in filenames:
ith = pattern_ith.findall(filename)
@jinyu121
jinyu121 / annotation_to_voc_xml.py
Created March 29, 2017 11:52
实验室数据集
# -*- coding: utf-8 -*-
import os
import re
import random
import lxml.etree as ElementTree
import dicttoxml
from xml.dom.minidom import parseString
from collections import OrderedDict
@jinyu121
jinyu121 / CMakeLists.txt
Created March 29, 2017 12:03
将oni拆分成RGB图和D图
cmake_minimum_required(VERSION 3.6)
project(onion)
# compile with C++11 support
add_definitions("-std=c++0x -Dlinux -D__STANDALONE_ONI_EXTRACTOR")
# OpenCV
find_package(OpenCV REQUIRED)
# OpenNI
@jinyu121
jinyu121 / annotation_to_voc.py
Last active April 4, 2017 07:19
韩国PR2数据集和UM数据集
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import os
import cv2
from skimage import io, draw
import os
import re
import random
import lxml.etree as ElementTree
# -*- coding: utf-8 -*-
import os
import xml.etree.ElementTree as ET
from skimage import io, draw
xml_folder = "/home/haoyu/Annotations"
image_dir = "/home/haoyu/JPEGImages"
for parent, dirnames, filenames in os.walk(xml_folder):
for filename in filenames:
@jinyu121
jinyu121 / haoyu_1_cleanup.sh
Last active May 8, 2017 01:32
RCNN自动化脚本
# 删除 Cache
rm -Rf ./cachedir/*
# 删除 selective_search_data
rm -Rf ./data/selective_search_data/*
# 删除网络模型 finetune_voc_2007_trainval_iter_70k
rm -Rf data/caffe_nets/finetune_voc_2007_trainval_iter_70k
# 删除 备份网络配置和训练快照
@jinyu121
jinyu121 / function.js
Created July 16, 2017 03:37
狡猾的标题栏(失去焦点就变成其他文字)
$(document).ready(function(a) {
t = document.title,
d = "(●—●) 你快回来~ | " + t;
$(window).blur(function() {
document.title = d
}).focus(function() {
document.title = t
});
});
@jinyu121
jinyu121 / run_test.sh
Created August 12, 2017 11:27
Caffe Auto Train and test
BASE_DIR="examples/jinyu121-alexnet"
BACK_DIR="${BASE_DIR}/backups"
PRE="alexnet"
GPU_NUM=1
LOG="/tmp/haoyu_log.log"
cd ../../
build/tools/caffe time -gpu ${GPU_NUM} -phase TEST -model ${BASE_DIR}/train_val.prototxt >${LOG} 2>&1
echo $(tail ${LOG} -n5 | head -n3 | cut -d "]" -f2 | cut -d ":" -f2)
@jinyu121
jinyu121 / WeiboPicDownloader.py
Last active September 17, 2017 13:59
免登录下载微博大图
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 15 01:38:07 2017
@author: nondanee
"""
import os
import sys
import locale