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
mkdir repo | |
cd repo | |
git clone --bare path/to/repo.git .git | |
git config --unset core.bare | |
git reset --hard |
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 torch | |
import torch.nn as nn | |
from typing import Optional | |
from math import ( | |
pi, | |
sqrt, | |
) |
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 torch | |
from typing import ( | |
Any, | |
List, | |
Dict, | |
) | |
def calc_batch_rec_metrics_per_k(ranks: torch.LongTensor, |
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 os | |
from unicodedata import normalize | |
def walk_normalize(target_dir): | |
for root, dirs, files in os.walk(target_dir): | |
for name in files: | |
path = os.path.join(root, name) | |
if name == '.DS_Store': |
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 random | |
import PIL | |
import PIL.ImageOps | |
import PIL.ImageEnhance | |
import PIL.ImageDraw | |
__all__ = ( | |
'augment_bound', |
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
def get_logger(name, log_dir, use_formatter=True): | |
# 함수를 처음 부르는 경우, static 변수를 추가 | |
if not hasattr(get_logger, '_name2logger'): | |
get_logger._name2logger = {} | |
# 생성한적 없는 로거 객체의 경우, 초기화 | |
if name not in get_logger._name2logger: | |
# 로그 파일 경로 설정 |
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
# -*- coding: utf -*- | |
import os | |
import time | |
import logging | |
import argparse | |
import requests | |
from bs4 import BeautifulSoup |
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
# -*- coding: utf-8 -*- | |
import os | |
import shutil | |
TARGET_PATH = "" | |
bad_dirnames = ( | |
'venv', |
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
# -*- coding: utf-8 -*- | |
import os | |
import subprocess | |
def entry(): | |
for root, _, _ in os.walk('.', topdown=True): | |
if root == '.': | |
continue |
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
# syntax=docker/dockerfile:experimental | |
# from | |
FROM pytorch/pytorch:1.2-cuda10.0-cudnn7-runtime | |
LABEL maintainer="Jamie Seol <[email protected]>" | |
# apt init | |
ENV PYTHONUNBUFFERED=1 | |
ENV LANG=C.UTF-8 | |
ENV TZ=Asia/Seoul |
NewerOlder