Skip to content

Instantly share code, notes, and snippets.

View rhee-elten's full-sized avatar

rhee-elten

  • Linkgenesis
  • Seoul, South Korea
  • 03:26 (UTC +09:00)
View GitHub Profile
# wsl boot scripts (win side, linux side) - wsl-on-boot.bat .wslconfig wsl.conf wsl-on-boot.bash
# gist: https://gist.github.com/rhee-elten/f4c5f931513bb37c9f50ca1f5d95cc3c
(1) wsl-on-boot.bat (windows side)
@rem wsl-on-boot.bat
wsl --mount \\.\PHYSICALDRIVE1 --partition 2 --name ext
wsl cat /etc/issue.net
for /f "tokens=1" %%i in ('wsl hostname -I') do set WSL_ADDR=%%i
from contextlib import contextmanager
from collections.abc import Iterable
import matplotlib.pyplot as plt
import cv2
import numpy as np
@contextmanager
def fourplots(cols=4, figsize=(11, 2.5), dpi=100, set_axis=False, grid_props=None, **kwargs):
import numpy as np
from tqdm.auto import tqdm
def make_circle_kernel(radius):
"""
test:
for radius in [5]:
"""
HOUGH_GRADIENT_ALT (Scharr algorithm) 의 경우
파라메터 권장값이 소개되어 있어서 이를 적용해 본다.
"""
from functools import partial
from time import perf_counter
import cv2
@rhee-elten
rhee-elten / obj_summary.py
Created September 12, 2024 00:56
obj_summary.py
# obj_summary.py
# gist: https://gist.github.com/rhee-elten/84569d1a5ef3bfee37beac52c4d7ac04
import sys
from functools import partial
import numpy as np
import pandas as pd
def obj_summary(obj, *, key=None, prefix="", visited=None):
@rhee-elten
rhee-elten / keras-gradcam-p1-re.py
Last active September 3, 2024 03:52
keras gradcam 예제
#!/usr/bin/env python
# coding: utf-8
# In[1]:
## gist: https://gist.github.com/rhee-elten/ca633edcf039069015e8ccd7faaa099a
## keras 모델로 p1 데이터셋을 학습하고, 테스트 데이터셋에 대한 gradcam 을 추출
## 93.87% 94.86% VAL AUC 최고치 였던 저장 파일 사용
_backbone = 'DenseNet169'
###########################################
# video streaming using gst or vc.txt
# gist: https://gist.github.com/rhee-elten/566be98345a95cad67f053f565462333
###########################################
[gst]
# run-gst-8080-http.bash
set -x
gst-launch-1.0 v4l2src ! \
@rhee-elten
rhee-elten / cuda_select_best_memfree.py
Last active April 1, 2024 23:55
cuda_select_best_memfree.py
#!/usr/bin/env python
# coding: utf-8
## cuda_select_best_memfree.py 는 python2 에서도 실행되면 좋겠다. (시스템 파이썬 사용)
## gist https://gist.github.com/rhee-elten/223124ba106e7b9927078a4a1a8c320e
from __future__ import print_function
import sys
import os
import subprocess
:
if ! -z "$DEVPI_FORWARD"
then
docker run -dit --restart unless-stopped \
-p 3141:3141 \
--name devpi alpine/socat:1.7.4.4 \
tcp-listen:3141,fork,reuseaddr tcp-connect:$DEVPI_FORWARD:3141
else
docker run -dit --restart unless-stopped \
-p 3141:3141 \
:
<<EEE >/dev/null
https://github.com/EpicWink/proxpi
Environment variables
PROXPI_INDEX_URL: index URL, default: https://pypi.org/simple/
PROXPI_INDEX_TTL: index cache time-to-live in seconds, default: 30 minutes. Disable index-cache by setting this to 0
PROXPI_EXTRA_INDEX_URLS: extra index URLs (comma-separated)