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
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): | |
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 numpy as np | |
from tqdm.auto import tqdm | |
def make_circle_kernel(radius): | |
""" | |
test: | |
for radius in [5]: |
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
""" | |
HOUGH_GRADIENT_ALT (Scharr algorithm) 의 경우 | |
파라메터 권장값이 소개되어 있어서 이를 적용해 본다. | |
""" | |
from functools import partial | |
from time import perf_counter | |
import cv2 |
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
# 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): |
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 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' |
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
########################################### | |
# 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 ! \ |
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 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 |
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
: | |
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 \ |
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
: | |
<<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) |
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
""" | |
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`. |
NewerOlder