Skip to content

Instantly share code, notes, and snippets.

Loui Sakaki LouiS0616

Block or report user

Report or block LouiS0616

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import pathlib
import re
import cv2
import numpy as np
import tqdm
_color_convert_dct = {
# B G R
import collections
class PriorityDict(
def __init__(self, default_priority_func):
self._default_priority_func = default_priority_func
self._inner_keys = set()
class NamedZip:
def __init__(self, dct=None, **kwards):
if dct:
kwards = {**dct, **kwards}
self._names = kwards.keys()
self._iters = [
iter(val) for val in kwards.values()
from pathlib import Path
import cv2
import numpy as np
from tqdm import tqdm
def main(filename):
# 画像を読み込む
import math
def compute_lcm(a, b):
return (a * b) // math.gcd(a, b)
class MyFraction:
def __init__(self, numerator, denominator=1):
if denominator == 0:
raise ValueError
def printable_func(str_func=None):
if str_func is None:
str_func = lambda func: func.__name__
def inner(func):
return type(
func.__name__, (object, ),
from pathlib import Path
_Path = type(Path())
class Path(_Path):
def __iter__(self):
if self.is_dir():
return self.iterdir()
raise TypeError
LouiS0616 / LICENSE
Created Apr 6, 2018
This license applies to all public gists
MIT License
Copyright (c) 2018 Loui Sakaki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
OpenCV utility functions.
from functools import singledispatch
import cv2
BackendError = type('BackendError', (Exception,), {})
def _is_visible(winname):
LouiS0616 /
Last active Mar 15, 2018
Holdable button sample.
public class HoldableButton extends AppCompatButton {
private int delayMsec;
private int intervalMsec;
private MainTask mainTask;
private final Handler handler = new Handler();
private Runnable runnableCode;
You can’t perform that action at this time.