Skip to content

Instantly share code, notes, and snippets.

View rhee-elten's full-sized avatar

rhee-elten

  • Linkgenesis
  • Seoul, South Korea
  • 06:30 (UTC +09:00)
View GitHub Profile
@rhee-elten
rhee-elten / proc_stdout_gen.py
Created May 16, 2022 00:59
## gen() function for proc.stdout ( run_commands, vdl_run ) ## async read from proc.stdout
## gen() function for proc.stdout ( run_commands, vdl_run )
## async read from proc.stdout
if True:
def gen(proc):
remains = b'' # remaining from prev read
while proc.poll() is None:
rlist, _, _ = select([proc.stdout],[],[],500)
if proc.stdout not in rlist:
continue
data = os.read(proc.stdout.fileno(), 16384)
@rhee-elten
rhee-elten / Windows Process List How To.txt
Last active May 16, 2022 01:33 — forked from rhee/Windows Process List How To.txt
Windows Process List How To.txt
Windows Process List How To.txt
## https://www.nextofwindows.com/windows-tip-3-ways-to-print-a-list-of-running-processes
tasklist
tasklist /v /fi "sessionname eq console" /fo csv
PS C:\> get-process | out-file $env:userprofile\desktop\processes.txt
PS C:\> get-process-computername computername
PS C:\> get-process | out-printer
@rhee-elten
rhee-elten / TF_FORCE_GPU_ALLOW_GROWTH_example.bashrc
Last active May 16, 2022 03:12 — forked from rhee/TF_FORCE_GPU_ALLOW_GROWTH_example.bashrc
TF_FORCE_GPU_ALLOW_GROWTH_example.bashrc
:
export TF_FORCE_GPU_ALLOW_GROWTH=true
export CUDA_DEVICE_ORDER=PCI_BUS_ID
export CUDA_VISIBLE_DEVICES=0,1,2,3
export TF_CPP_MIN_LOG_LEVEL=3
# 참고: https://github.com/tensorflow/tensorflow/issues/22936#issuecomment-441790882
# Would you mind running your code with the following environment variables set:
# TF_ENABLE_WHILE_V2=1 TF_ENABLE_COND_V2=1 ??
## monitor GPU usage in jupyter notebook -- rhee.elten@gmail.com
## https://gist.github.com/rhee-elten/1a1070e3a812ca863c3b937b5180b2f8
# pylint: disable=invalid-name
# pylint: disable=using-constant-test
# pylint: disable=wrong-import-position
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring
if 10:
import os
//////////////////////////
cvat-ui/src/reducers/index.ts
292:
export interface ShareFileInfo {
// get this data from cvat-core
name: string;
type: 'DIR' | 'REG';
mime_type: string;
from traceback import print_exc
import sys
import os
from os.path import relpath, realpath, basename, dirname, splitext
from time import perf_counter
import numpy as np
import cv2
from sklearn.cluster import KMeans, MiniBatchKMeans
from glob import glob
import matplotlib.pyplot as plt
#
import traceback
_in_notebook = any(
( rstk[0].startswith("<ipython")
or "/site-packages/IPython/core/interactiveshell.py" in rstk[0]
)
for rstk in traceback.extract_stack())
#!/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
# 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
import cv2
import pandas as pd
import numpy as np
"""
HoughCircles(image, method, dp, minDist[, circles[, param1[, param2[, minRadius[, maxRadius]]]]]) -> circles
. @brief Finds circles in a grayscale image using the Hough transform.
.