Skip to content

Instantly share code, notes, and snippets.

@aic25
aic25 / bash_to_zsh_history.rb
Created July 8, 2019 05:09 — forked from goyalankit/bash_to_zsh_history.rb
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
@aic25
aic25 / coco_to_voc.py
Created June 5, 2019 10:07 — forked from jinyu121/coco_to_voc.py
Convert COCO to VOC
import json
import os
from tqdm import tqdm
from xmltodict import unparse
# BBOX_OFFSET: Switch between 0-based and 1-based bbox.
# The COCO dataset is in 0-based format, while the VOC dataset is 1-based.
# To keep 0-based, set it to 0. To convert to 1-based, set it to 1.
BBOX_OFFSET = 0
@aic25
aic25 / runt_image.sh
Created April 18, 2019 05:35
Create container from image
#!/bin/bash
#xhost +
usage ()
{
echo "kwargs : $0 <$1:docker image> <$2:container name> <$3:port to open>"
exit
}
if [ "$#" -ne 3 ]
then
usage
@aic25
aic25 / docker_set_jp_lang.sh
Created April 18, 2019 05:32
Set container lang to JP
#!/bin/bash
apt-get install -y language-pack-ja-base language-pack-ja
update-locale LANG=ja_JP.UTF-8 LANGUAGE=ja_JP:ja
export LANG=ja_JP.UTF-8
export LC_ALL=ja_JP.UTF-8
export LC_CTYPE=ja_JP.UTF-8
@aic25
aic25 / CMakeLists.txt
Created April 9, 2019 00:26 — forked from UnaNancyOwen/CMakeLists.txt
How to use OpenCV FreeType module with Visual Studio
cmake_minimum_required( VERSION 3.6 )
# Create Project
project( test )
add_executable( freetype main.cpp )
# Set StartUp Project
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "freetype" )
# Set CharacterSet
@aic25
aic25 / faster_rcnn_webcam.py
Created April 1, 2019 03:56 — forked from allskyee/faster_rcnn_webcam.py
Faster RCNN (ZFnet) detection and classification on image from webcam
#!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see https://github.com/rbgirshick/py-faster-rcnn/blob/master/LICENSE for details]
# Written by Ross Girshick
# Modified by Sky Chon for webcam use
# --------------------------------------------------------
@aic25
aic25 / fast_ai_mooc_important_points.md
Created March 5, 2019 15:04 — forked from bhavikngala/fast_ai_mooc_important_points.md
This gist contains a list of important points from fast.ai "practical deep learning for coders" and "cutting edge deep learning for coders" MOOC

This gist contains a list of points I found very useful while watching the fast.ai "Practical deep learning for coders" and "Cutting edge deep learning for coders" MOOC by Jeremy Howard and team. This list may not be complete as I watched the video at 1.5x speed on marathon but I did write down as many things I found to be very useful to get a model working. A fair warning the points are in no particular order, you may find the topics are all jumbled up.

Before beginning, I want to thank Jeremy Howard, Rachel Thomas, and the entire fast.ai team in making this awesome practically oriented MOOC.

  1. Progressive image resolution training: Train the network on lower res first and then increase the resolution to get better performance. This can be thought of as transfer learning from the same dataset but at a different resolution. There is one paper by NVIDIA as well that used such an approach to train GANs.

  2. Cyclical learning rates: Gradually increasing the learning rate initially helps to avoid getting stuc

@aic25
aic25 / client.c
Created January 21, 2019 09:12 — forked from Alexey-N-Chernyshov/client.c
Example of client/server with select().
// Simple example of client.
// Client prints received messages to stdout and sends from stdin.
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/select.h>
#include <netinet/in.h>
@aic25
aic25 / find_rename_copy
Created January 7, 2019 22:43
Find BER files and copy them to manage multiprocessing.
#! /bin/bash
find -name "BER.dat" | cat -n | while read n f; do
cp "$f" "$n".xx
done
sum=$(ls -l *.xx | wc -l)
paste -d" " *.xx | awk -v s="$sum" '{
for(i=0;i<=s-1;i++)
{
t1 = 2+(i*2)
@aic25
aic25 / file_with_space
Created January 7, 2019 22:40
To deal with filenames with spaces
#!/bin/bash
DIR="."
find $DIR -type f | while read file; do
if [[ "$file" = *[[:space:]]* ]]; then
mv "$file" `echo $file | tr ' ' '_'`
fi
done