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
git filter-branch --env-filter ' | |
WRONG_EMAIL="" | |
NEW_NAME="" | |
NEW_EMAIL="" | |
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$NEW_NAME" | |
export GIT_COMMITTER_EMAIL="$NEW_EMAIL" | |
fi |
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
# This is for Ubuntu 18.04, 16.04, 14.04 | |
# Make sure Nvidia Drivers, cuda and cudnn are well installed in the machine on which you want to install DeepDetect | |
# Prefer cuda 10.1 instead of cuda 10.2 (cuda 10.2 is not well supported). | |
# https://www.deepdetect.com/ | |
# Install dependencies based on version of ubuntu | |
unbuntu_version=$(echo "$(lsb_release -r)" | cut -f2 | cut -d '.' -f1) | |
if [ $unbuntu_version = 18 ] | |
then | |
# Prepare temp folder |
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
# If you come from bash you might have to change your $PATH. | |
# Path to your oh-my-zsh installation. | |
MYUSER=`whoami` | |
export ZSH="/home/${MYUSER}/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes | |
ZSH_THEME="refined" |
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 json | |
import os | |
from glob import glob | |
input_doc = "TODO" # can be a json doc or a folder containing only jsons | |
output_ljson = "{}_output.ljson".format('.'.join(input_doc.split('.')[:-1])) | |
def transform_input_to_dumpable(input_doc): |
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 re | |
def atoi(text): | |
return int(text) if text.isdigit() else text | |
def natural_keys(text): | |
''' | |
alist.sort(key=natural_keys) sorts in human order | |
http://nedbatchelder.com/blog/200712/human_sorting.html | |
(See Toothy's implementation in the comments) |
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 urllib.request | |
import shutil | |
def downloader(image_url, basename, index=None): | |
req = urllib.request.Request(image_url, headers={'User-Agent': 'Mozilla/5.0'}) | |
if index: | |
full_file_name = basename + '-' + str(index) + '.jpg' | |
else: | |
full_file_name = basename + '.jpg' | |
with urllib.request.urlopen(req) as response, open(full_file_name, 'wb') as out_file: |
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 hashlib | |
from glob import glob | |
from pathlib import Path | |
import argparse | |
import os | |
def get_args(): | |
parser = argparse.ArgumentParser( | |
"Detect identical files." |
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 copy | |
import cv2 | |
import os | |
def merge_bboxes(bboxes, delta_x=0.1, delta_y=0.1): | |
""" | |
Arguments: | |
bboxes {list} -- list of bounding boxes with each bounding box is a list [xmin, ymin, xmax, ymax] | |
delta_x {float} -- margin taken in width to merge |
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
file_path="" | |
git update-index --assume-unchanged ${file_path} |
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
NAME_WEBSITE="" | |
COOKIES="" | |
wget --mirror \ | |
--convert-links \ | |
--adjust-extension \ | |
--page-requisites \ | |
--no-parent \ | |
--random-wait \ | |
-r -p -e robots=off -U mozilla \ |