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 bash | |
# https://unix.stackexchange.com/a/427133 | |
if [ `uname` == "Linux" ]; then | |
tail --pid=$1 -f /dev/null | |
else | |
lsof -p $1 +r 1 &>/dev/null | |
fi |
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 bash | |
# Origin code: https://rclone.org/install.sh | |
# error codes | |
# 0 - exited without problems | |
# 1 - parameters not supported were used or some unexpected error occurred | |
# 2 - OS not supported by this script | |
# 3 - installed version of rclone is up to date | |
# 4 - supported unzip tools are not available |
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/bash | |
set -e | |
TMP_BTOP_DIR="/tmp/$USER/btop/" | |
mkdir -p $TMP_BTOP_DIR | |
cd $TMP_BTOP_DIR | |
curl --remote-name-all -o "$TMP_BTOP_DIR/btop.tbz" --location $( \ | |
curl -s https://api.github.com/repos/aristocratos/btop/releases/latest \ | |
| grep "browser_download_url.*$(uname -m)-linux.*" \ | |
| cut -d : -f 2,3 \ |
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 logging | |
import os | |
import hydra | |
import torch | |
import datetime | |
import torch.distributed as dist | |
import torch.multiprocessing as mp | |
from omegaconf import OmegaConf | |
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 glob | |
from PIL import ImageFont, ImageDraw, Image | |
from multiprocessing import Pool | |
from functools import partial | |
import random | |
import tqdm | |
def imwrite(input_, save_dir): | |
i, data = input_ |
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
# made by @mori_inj | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import cv2 | |
p = 2#np.inf | |
pert = 100#1000 | |
im = cv2.imread('00000000.png') | |
#print(type(im)) # 처음부터 numpy | |
#print(im.shape) # (H, W, C) |
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 cv2 | |
import glob | |
import os | |
import tqdm | |
from itertools import islice | |
from multiprocessing import Pool | |
from pathlib import Path | |
path = r'D:\Google Drive(SNU)\Study\Dataset\EDVR\Inference\dance_1080_120fs\dance_4k_60fps_downscaled\*.png' | |
img_size = [(1080, 2048,3)] # Width, Height |
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 cv2 | |
import glob | |
import os | |
import tqdm | |
from itertools import islice | |
from multiprocessing import Pool | |
from pathlib import Path | |
path = r'./**/*.png' | |
resize_factor = (0.5, 0.5) # Width, Height |
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 cv2 | |
import glob | |
import os | |
import tqdm | |
from itertools import islice | |
from multiprocessing import Pool | |
import numpy as np | |
from pathlib import Path | |
path = r'/path/to/image/*.png' |
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
# assemble images which is splited by split_image.py | |
import cv2 | |
import glob | |
import os | |
import tqdm | |
import numpy as np | |
from itertools import islice | |
from multiprocessing import Pool |
NewerOlder