Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Magic wand selection with OpenCV Python. | |
The code highly credits to https://github.com/alkasm/magicwand, but this script only relies on tkinter for user interface. | |
Please run the code by simply calling: $ python magic_wand_opencv.py | |
Requirements: Python 3.9+, Pillow, opencv-python>=4.6 | |
""" | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, you need to install node.js. After you install node.js, type `npm -v` for check | |
mkdir ~/.local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
# curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 # For node.js v10.x, there is a hanging issue when installing jupyter-labextension | |
curl http://nodejs.org/dist/v8.9.0/node-v8.9.0.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/.local | |
make install -j20 # ok, fine, this step probably takes more than 30 seconds... | |
# curl -k -L https://npmjs.org/install.sh | sh # This doen't need now, since npm is installed together when installing node.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PREFIX="$HOME/.local/" | |
install_vmtouch() { | |
# The project page of linux "vmtouch" command is located at https://github.com/hoytech/vmtouch | |
TMP_VMTOUCH_DIR="/tmp/$USER/vmtouch"; mkdir -p $TMP_VMTOUCH_DIR | |
cd $TMP_VMTOUCH_DIR | |
git clone https://github.com/hoytech/vmtouch.git | |
cd vmtouch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PREFIX="$HOME/.local/" | |
install_tree() { | |
# The project page of linux "tree" command is located at http://mama.indstate.edu/users/ice/tree | |
TMP_TREE_DIR="/tmp/$USER/tree"; mkdir -p $TMP_TREE_DIR | |
wget -nc -O $TMP_TREE_DIR/tree.tgz "http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz" | |
tar -xvzf $TMP_TREE_DIR/tree.tgz -C $TMP_TREE_DIR --strip-components 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import tensorflow as tf | |
import numpy as np | |
if len(sys.argv) == 2: | |
ckpt_fpath = sys.argv[1] | |
else: | |
print('Usage: python count_ckpt_param.py path-to-ckpt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/usr/env python | |
# Usage: python pdf_even_page.py | |
import os | |
import PyPDF2 | |
import re | |
def make_even_page(in_fpath, out_fpath): | |
reader = PyPDF2.PdfFileReader(in_fpath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
CAFFE_ROOT = '../../' | |
sys.path.insert(0, CAFFE_ROOT + 'python/') | |
import caffe | |
import numpy as np | |
if len(sys.argv) != 3: | |
print "Usage: python protomean_to_npy.py proto.mean out.npy" | |
sys.exit() |
NewerOlder