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 / visible_faster_rcnn_result.py
Last active December 16, 2018 15:27
Faster RCNN 结果可视化
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import os
from sklearn.externals import joblib
from skimage import io, draw, img_as_float
pkl_pred = "py-faster-rcnn/output/faster_rcnn_alt_opt/voc_2007_test/VGG16_faster_rcnn_final/detections.pkl"
pkl_anno = "py-faster-rcnn/data/VOCdevkit2007/annotations_cache/annots.pkl"
# -*- 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 / 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
@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 / homework_check.py
Last active August 20, 2019 02:38
C++助教作业辅助脚本:自动生成CMakelists、编译、运行,与CLion兼容
# -*- coding: utf8 -*-
import os
import argparse
# 工作目录
working_dir = 'cmake-build-debug'
# 被保护的文件
file_protect = ['CMakeLists.txt', 'run.sh', 'data.txt', 'run.py', 'main.py']
# 需要被复制的文件
file_copy = ['data.txt']
@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
});
});