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 | |
# acknowledgement: | |
# https://chemicloud.com/blog/download-google-drive-files-using-wget/#how-to-download-google-drive-files-using-wget | |
# https://stackoverflow.com/a/6174447 | |
function parse-url() { | |
# extract the protocol | |
proto="$(echo $1 | grep :// | sed -e's,^\(.*://\).*,\1,g')" | |
# remove the protocol |
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 code CANNOT be run as a script. | |
# You should add this code to your shell rc file and use it as a shell function. | |
# This is because the `jobs` command can only get child processes. | |
# | |
# example: `for i in $(seq 1 24); do run-parallel sleep 6; done; wait` | |
function run-parallel() { | |
MAX_JOBS=${MAX_JOBS:-6} | |
while [ $(jobs -r | wc -l) -ge $MAX_JOBS ]; do |
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 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 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 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 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 | |
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 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 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 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 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 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
# 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 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 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 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 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 |
NewerOlder