Skip to content

Instantly share code, notes, and snippets.

View BIGBALLON's full-sized avatar
🎯
Focusing

WILL LEE BIGBALLON

🎯
Focusing
View GitHub Profile
@BIGBALLON
BIGBALLON / docker-owncloud.sh
Created November 13, 2019 07:50
docker-owncloud
# uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc
# install latest versions
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
@BIGBALLON
BIGBALLON / gym_test.py
Last active January 2, 2020 05:49
REINFORCE
import argparse
import gym
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import seaborn as sns
import pandas as pd
import numpy as np
from PIL import Image, ImageOps
def padding(img, expected_size):
desired_size = expected_size
delta_width = desired_size - img.size[0]
delta_height = desired_size - img.size[1]
pad_width = delta_width // 2
pad_height = delta_height // 2
padding = (pad_width, pad_height, delta_width - pad_width, delta_height - pad_height)
@BIGBALLON
BIGBALLON / install-tmux.sh
Created June 15, 2020 06:55 — forked from pokev25/install-tmux.sh
Install tmux 2.8 on centos 7
# Install tmux 2.8 on Centos
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -xf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=/usr/local
@BIGBALLON
BIGBALLON / iterm2.md
Created November 19, 2020 15:28 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@BIGBALLON
BIGBALLON / botnet50.log
Created March 16, 2021 16:10
botnet50 training log via distribuuu
This file has been truncated, but you can view the full file.
[2021-03-14 04:47:11] LOCAL_RANK: 0, RANK: 0
[2021-03-14 04:47:11]
CFG_DEST: config.yaml
CUDNN:
BENCHMARK: true
DETERMINISTIC: false
MODEL:
ARCH: botnet50
PRETRAINED: false
SYNCBN: false
@BIGBALLON
BIGBALLON / .vimrc
Created March 26, 2021 10:53
vim configuration
" BASIC SETTING
set number
set noswapfile
set autoindent
set cindent
set mouse=a
set encoding=utf-8
set cursorcolumn
set cursorline
@BIGBALLON
BIGBALLON / conv.py
Created March 26, 2021 13:13
ddp->single
import torch
checkpoint = torch.load("resnet18.pth.tar")
state_dict = checkpoint["state_dict"]
from collections import OrderedDict
new_state_dict = OrderedDict()
for k, v in state_dict.items():
name = k[7:] # remove 'module.' of dataparallel
import numpy as np
def voc_ap(rec, prec):
# correct AP calculation
# first append sentinel values at the end
mrec = np.concatenate(([0.], rec, [1.])) #[0. 0.0666, 0.1333, 0.4 , 0.4666, 1.]
mpre = np.concatenate(([0.], prec, [0.])) #[0. 1., 0.6666, 0.4285, 0.3043, 0.]
for i in range(mpre.size - 1, 0, -1):
mpre[i - 1] = np.maximum(mpre[i - 1], mpre[i]) #[1. 1. 0.6666 0.4285 0.3043 0. ]
@BIGBALLON
BIGBALLON / EMAE_crop.py
Last active November 4, 2022 10:48
for EMAE figures
import math
import os
import random
from itertools import product
import numpy as np
from imgaug import augmenters as iaa
from PIL import Image
IMG_SIZE = 600