Skip to content

Instantly share code, notes, and snippets.

View ahangchen's full-sized avatar
🎯
Focusing

梦里茶 ahangchen

🎯
Focusing
View GitHub Profile
@ahangchen
ahangchen / label_xml.py
Created March 16, 2018 07:29
Convert image label file to coco style xml
def label2xml(list_path, category_id, ANN_DIR='data/Annotations/', IMG_DIR='data/images/', SET_DIR='data/ImageSets/',
train=True):
set_file_list = [SET_DIR + 'train.txt', SET_DIR + 'minival.txt', SET_DIR + 'testdev.txt', SET_DIR + 'test.txt']
TYPEPREFIX = 'train' if train else 'val'
lines = read_lines(list_path)
line_i = 0
last_name = ''
E = None
img_annotation = None
@elgehelge
elgehelge / mnist_estimator.py
Last active May 22, 2022 21:43 — forked from peterroelants/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.5"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
# Show debugging output
tf.logging.set_verbosity(tf.logging.DEBUG)
# Set default flags for the output directories
@farrajota
farrajota / mpii_mat2json.m
Last active December 27, 2023 13:45
Convert mpii annotations from .mat to .json format
function mpii_convert_json( )
% convert mpii annotations .mat file to .json
%% load annotation file
fprintf('Load annotations... ')
data = load('/media/HDD2/Datasets/Human_Pose/mpii/mpii_human_pose_v1_u12_2/mpii_human_pose_v1_u12_1.mat');
fprintf('Done.\n')
%% open file
fprintf('Open file mpii_human_pose_annotations.json\n')