Skip to content

Instantly share code, notes, and snippets.

View rhee-elten's full-sized avatar

rhee-elten

  • Linkgenesis
  • Seoul, South Korea
  • 10:41 (UTC +09:00)
View GitHub Profile
@rhee-elten
rhee-elten / keras-cv--fasterrcnn--patch.txt
Created August 9, 2023 04:12
fasterrcnn 에서 동작하도록 하기 위해서는 keras_cv 에 다음 패치 필요: keras_cv/layers/object_detection/anchor_generator.py
"""
fasterrcnn 에서 동작하도록 하기 위해서는 keras_cv 에 다음 패치 필요:
keras_cv/layers/object_detection/anchor_generator.py
line 258:
stride = self.stride
# make sure range of `cx` is within limit of `image_width` with
# `stride`, also for sizes where `image_width % stride != 0`.
#!/bin/bash
set -e; set -u
COMMON_SUBDOMAINS="www mail mx a.mx smtp pop imap blog en ftp ssh login"
EXTENDED=""
while :; do case "$1" in
--) shift; break ;;
-x) EXTENDED=y; shift ;;
-s) NS="$2"; shift 2 ;;
*) break ;;
@rhee-elten
rhee-elten / render-notebook.bash
Last active August 4, 2023 01:46
[WIP] gitea renderer - jupyter notebook using nb.js (TBD frame security check workaround) /////////////////////////////
#!/bin/bash
mkdir -p "${GITEA_CUSTOM}/tmp/render-notebook"
exec 2>> "${GITEA_CUSTOM}/tmp/render-notebook/trace.txt"
## DEBUG: echo params & envs
## PARAMS:
echo "=== Script: $(dirname $0)" 1>&2
echo "=== Date: $(date +'%Y-%m-%d %H:%M:%S')" 1>&2
echo "=== Args:" "$@" 1>&2
@rhee-elten
rhee-elten / fix-env_vars-scripts.bash
Last active March 19, 2024 04:37
fix LD_LIBRARY_PATH for conda and WSL
:
set -x
CONDA_PREFIX=${CONDA_PREFIX-$1}
save_LD_LIBRARY_PATH="$(echo LD_LIBRARY_PATH__$(echo $CONDA_DEFAULT_ENV | tr .- __))"
## find libdevice for XLA_FLAGS ## workaround for error: "libdevice not found at ./libdevice.10.bc"
if test -f $CONDA_PREFIX/lib/libdevice.*.bc
then
# mpl_korfont.py
# coding: utf-8
# gist: https://gist.github.com/rhee-elten/d36d1e907e66a9a548fdbfdceb2c469a
import sys
from os.path import isfile, basename, realpath
"""
font size comparison (kB):
1300 NanumBarunGothicSubset.ttf
@rem netsh interface portproxy example
@echo off
setlocal
@rem C:\Windows\System32\bash.exe -c "sudo /usr/sbin/service ssh start"
wsl sudo /usr/sbin/service ssh start
for /f %%i in ('wsl hostname -I') do set IP=%%i
netsh.exe interface portproxy delete v4tov4 listenport=2222 listenaddress=127.0.0.1 protocol=tcp
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
## gist: https://gist.github.com/rhee-elten/25f4776422b39af00db92b9291232b33/
# ## 2020.12.11_2 데이터에서 100개를 샘플로 가져와서 로컬에 1/2 사이즈로 저장
#!/usr/bin/env python
# coding: utf-8
# In[2]:
## 한글폰트 설정
get_ipython().run_line_magic('run', '-n mpl_korfont.py')
# coding: utf-8
from __future__ import print_function, division, absolute_import
import sys
import os
import re
import fnmatch
from collections import OrderedDict as odict
from functools import lru_cache
import numpy as np
import cv2
#!/bin/sh
_image=nvidia/cuda:10.0-devel-centos7 # 1.15, 1.13
#_image=nvidia/cuda:10.1-devel-centos7 # 2.4.1
#_image=nvidia/cuda:11.3.1-devel-centos7 # 2.5
_pwd="$(pwd)"
echo "=====================================" >> /tmp/ptxas_wrapper.log
echo "=== ptxas wrapper: $(date)" >> /tmp/ptxas_wrapper.log