Skip to content

Instantly share code, notes, and snippets.

Bassy BassyKuo

Block or report user

Report or block BassyKuo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BassyKuo
BassyKuo / stage.hh.diff
Created Feb 23, 2019
The patch file for stage.hh, please apply the patch with the command `patch <original_file> <patch_file>`. More information: https://github.com/rtv/Stage/issues/64
View stage.hh.diff
@@ -622,46 +622,46 @@
{ cont.erase( std::remove( cont.begin(), cont.end(), thing ), cont.end() ); }
// Error macros - output goes to stderr
-#define PRINT_ERR(m) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", __FILE__, __FUNCTION__)
-#define PRINT_ERR1(m,a) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, __FILE__, __FUNCTION__)
-#define PRINT_ERR2(m,a,b) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, __FILE__, __FUNCTION__)
-#define PRINT_ERR3(m,a,b,c) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, __FILE__, __FUNCTION__)
-#define PRINT_ERR4(m,a,b,c,d) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, d, __FILE__, __FUNCTION__)
-#define PRINT_ERR5(m,a,b,c,d,e) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, d, e, __FILE__, __FUNCTION__)
View DeepLab-LargeFOV.md
@BassyKuo
BassyKuo / CityScapes_IndexLabels.txt
Last active Jun 12, 2018
VOC2012/CityScapes/ADE20k labels
View CityScapes_IndexLabels.txt
000 road
001 sidewalk
002 building
003 wall
004 fence
005 pole
006 traffic light
007 traffic sign
008 vegetation
009 terrain
View tf_embedding_projector.Example.py
#!/usr/bin/env python3
import tensorflow as tf # tf.VERSION == 1.4.0
from tensorflow.contrib.tensorboard.plugins import projector
# ... write something here ...
dx, x_embedding = discriminator(x, is_training=True)
dz, z_embedding = discriminator(z, is_training=True)
@BassyKuo
BassyKuo / getpasswd
Created May 5, 2018
Generate random password.
View getpasswd
#!/bin/bash
#
# Uasge:
# getpasswd 64 ~/.vnc/passwd
#
length=${1:-128}
passwdfile=${2:-$HOME/.vnc/passwd}
if su -c true $USER ; then
head /dev/urandom | tr -dc 0-9a-zA-Z_ | head -c $length | tee /dev/tty | /usr/bin/vncpasswd -f > $passwdfile
View gpuUtil_threading.py
#!/usr/bin/env python3
import threading
import GPUtil
import numpy as np
gpu_loading = []
num_threads = 2
th = {}
@BassyKuo
BassyKuo / tf_orthogonal_initializer_test.py
Created Oct 30, 2017
Testing: Tensorflow orthogonal initializer
View tf_orthogonal_initializer_test.py
import tensorflow.contrib.slim as slim
import tensorflow as tf
import numpy as np
d_w_initializer = tf.orthogonal_initializer(1.0)
def discriminator(inputs, phase_train=True, reuse=False, use_bias=False, name="deGAN_d"):
net = inputs
pack = (
# [128, tf.nn.relu, d_w_initializer],
[128, tf.nn.relu, d_w_initializer],
[1, None, d_w_initializer]
View ImageNet64-count.txt
label count
0 2600
1 2600
2 2600
3 2600
4 2600
5 2300
6 2600
7 2600
8 2600
@BassyKuo
BassyKuo / hello_threading.py
Last active Jul 24, 2017
hello_threading.py
View hello_threading.py
#!/usr/bin/env python3
import threading
num_threads = 5
th = {}
def main():
@BassyKuo
BassyKuo / ReversePractice.c
Created Jan 22, 2017
Reverse using in-place & recursive
View ReversePractice.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* reverse (char* str) {
int len = strlen (str);
if (len < 1) return 0;
int tmp = *(str);
*str = *(str + (len-1) * sizeof(char));
*(str + (len-1) * sizeof(char)) = '\0';
You can’t perform that action at this time.