This file contains hidden or 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
# Source: https://github.com/joblib/joblib/pull/366#issuecomment-267603530 | |
# Source2: https://github.com/joblib/joblib/issues/522 | |
# Source3: https://github.com/mapillary/OpenSfM/blob/199f2dc4a535397afc8fdeb76d67053e76015b61/opensfm/reconstruction.py#L470 | |
import time | |
import multiprocessing | |
import functools | |
from joblib import Parallel, delayed | |
This file contains hidden or 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 tensorflow as tf | |
(major, minor, _) = tf.__version__.split(".") |
This file contains hidden or 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/bash | |
# Reference: https://unix.stackexchange.com/a/387631 | |
for d in */ ; do | |
echo $d | |
find $d -type f | sed -r 's/.*\/([^\/]+)/\1/' | sed 's/^[^\.]*$//' | sed -r 's/.*(\.[^\.]+)$/\1/' | sort | uniq -c | sort -nr | |
# files only | keep filename only | no ext -> '' ext | keep part after . (i.e. ext) | count | sort by count desc | |
done |
This file contains hidden or 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/python | |
''' | |
Source | |
https://gitlab.kuberlab.io/lsheiba/keras/blob/fbe7873fc0f43090e2df52b85867b8b6179516ca/keras/models.py | |
''' | |
from keras.models import load_model | |
from keras import layers as layer_module | |
import h5py, json, pprint |
This file contains hidden or 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
# Source: https://stackoverflow.com/questions/301134/how-to-import-a-module-given-its-name-as-string | |
import importlib | |
py_module = "std_msgs.msg" | |
py_class = "String" | |
PyClass = getattr(importlib.import_module(py_module), py_class)() |
This file contains hidden or 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/bash | |
# Reference: https://askubuntu.com/a/344396 | |
function _compare_hosts () { | |
echo "Usage: $ ./compare_pkgs.sh username@ip_address1 username@ip_address2 ~/.ssh/id_rsa1 ~/.ssh/id_rsa2" | |
# 1: remote_host = user@ip_address | |
# 2: ssh_key = ~/.ssh/id_rsa | |
if [[ ! -z $1 ]]; then | |
local remote_host1=$1 |
This file contains hidden or 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 | |
# reference: https://stackoverflow.com/a/13151299 | |
''' | |
Usage: | |
def hello(name): | |
print "Hello %s!" % name | |
print "starting..." |
This file contains hidden or 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/bash | |
trap "exit" INT TERM ERR | |
trap "kill 0" EXIT | |
HOME_DIR=$(getent passwd "$USER" | cut -d: -f6) | |
CURRENT_DIR=${PWD##*/} | |
WORKSPACE_PATH=$(pwd) | |
CUDA_VERSION=10.0 | |
export CUDA_VISIBLE_DEVICES=0,1 |
This file contains hidden or 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
# Source: https://stackoverflow.com/a/24439480 | |
from IPython.display import FileLink, FileLinks | |
FileLinks('.') # or FileLink() |
This file contains hidden or 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 pyrealsense2 as rs | |
import numpy as np | |
''' | |
Intrincs and Exrinsic information available from command line with RealSense SDK | |
$ rs-enumerate-devices -c | |
''' | |
config = rs.config() | |
config.enable_stream(rs.stream.depth, 1280, 720, rs.format.z16, 30) | |
config.enable_stream(rs.stream.color, 1920, 1080, rs.format.bgr8, 30) |