Skip to content

Instantly share code, notes, and snippets.

View pppoe's full-sized avatar
🎮
:)

Haoxiang Li pppoe

🎮
:)
View GitHub Profile
@pppoe
pppoe / export_3DDFA.m
Created February 13, 2017 01:00
export out data from 3DDFA
output_root = 'extracted';
mkdir(output_root);
num_lms = 68;
lines = textread('flist', '%s');
num_lines = length(lines);
for ff = 1:num_lines
fpath = lines{ff};
@pppoe
pppoe / UbuntuROS14.04.sh
Created April 14, 2017 21:37
Setup Ubuntu 14.04 and ROS
#! /bin/bash
sudo apt-get update
sudo apt-get install openbox tmux cmake vim git suckless-tools
git clone --recursive https://github.com/pppoe/Vim-Bash-Configuration
~/Vim-Bash-Configuration/make_symbolic_links.sh ~/Vim-Bash-Configuration/
sudo apt-get remove resolvconf update-manager network-manager
sudo apt-get install openssh-server
sudo apt-get install libudev-dev libusb-1.0-0-dev
# ROS
@pppoe
pppoe / setup.sh
Created February 6, 2018 06:12
A script to quickly install Tensorflow and setup a separated environment for dev
## put this into ~/Tensorflow/setup.sh settings are for Mac/CPU python3.5 by default, after installation, use $tf to load the env vars
#! /bin/bash
RootDir=$PWD/Tensorflow/
## Modify this line to install a different version of anaconda
AnacondaURL="https://repo.continuum.io/archive/Anaconda3-4.2.0-MacOSX-x86_64.sh"
## Modify this line to install a specific version of tensorflow
#! /bin/bash
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=$USER\
-t hxli .
#! /bin/bash
docker ps -aq -f status=exited | xargs docker rm
#! /bin/bash
@pppoe
pppoe / 2d-points-sampler.py
Created January 2, 2024 05:49
Sample 2D points from a 2D binary 0-1 mask
import numpy as np
import cv2
import random
I = cv2.imread('image.png')
mask = np.load('mask.npy')
mask = (mask[:,:,0] > 0) # True / False binary matrix
visI = np.zeros_like(I)
def sample_prompt_pts(mask, h_resol=128, w_resol=128, max_pts=128, K = 20):