전체 글

https://blog.leocat.kr/notes/2018/02/17/shell-looping-list [Shell] 배열 loop bash에서 배열 순환(loop)하는 방법(매번 까먹는다 =_=) blog.leocat.kr
기존에 적은 게시물의 연장이라 보면 될 것 같다. [PIL] Crop / Clip image by Polygon points. / PIL로 이미지 자르기 # FOR PNG shape import numpy from PIL import Image, ImageDraw # read image as RGB and add alpha (transparency) im = Image.open("crop.jpg").convert("RGBA") # convert to numpy (for convenience) imArray = numpy.asarray(im) # create mask polygon = [(444,203),( yjs-program.tistory.com 일전에 작성한대로 crop을 한 후, 해당 글자 이미지를..
class RawDataset(Dataset): def __init__(self, root): self.rgb = True self.image_path_list = [] for dirpath, dirnames, filenames in os.walk(root, followlinks=True): for name in filenames: _, ext = os.path.splitext(name) ext = ext.lower() if ext == ".jpg" or ext == ".jpeg" or ext == ".png": self.image_path_list.append(os.path.join(dirpath, name)) self.image_path_list = natsorted(self.image_path_li..
for var in {0..149} do cp ./images/test_$var.jpg ./new/images/ cp ./images/test_$var.txt ./new/labels/ done bash 파일을 만들고 다음과 같이 작성해 준 후, 1) "chmod +x move_file.sh"다음 명령어로 bash file 권한을 풀고, "./move_file.sh"로 실행하거나 2) "bash move_file.sh" 등 명령어로 실행하면 수행 가능.
Object Detection같은 수십개의 클래스에 대하여, 클래스 별 color를 다 다르게 맵핑하여 시각화 할 경우에는 다음 코드로 팔레트를 정의할 수 있다. CLASSES = [ A, B, C, D, ..., Z ] colors = np.random.uniform(0, 255, size=(len(CLASSES), 3))
git pull 로 최신 코드 받아오려는데, 내가 수정한 부분이 겹칠 경우 발생. 1. git stash로 내 코드 백업 2. git pull로 다른 코드들 땡겨오고 3. git stash pop으로 다시 내 코드 덮기
ssh로 개발 서버로 연결한 후, 별도의 접속 파일로 docker container 에 연결해서 작업을 하는 도중 발생한 이슈. streamlit이나 tensorboard와 같이 외부 접속 브라우저를 통해 시각화를 하는 과정에서 흰 배경만 떠있거나 Timed out 에러가 뜨면서 아예 streamlit이 무응답으로 동작하는 경우가 있었는데, 이는 ssh로 연결하다보니 생긴 이슈였다. vscode에서 [ctrl+shift+P]를 눌러 "Dev Containers: Attach to Running container..." 메뉴를 통해 접속하니 port의 꼬이는 이슈 없이 정상적으로 잘 동작한다.
streamlit 설치 후, 테스팅해보는데 다음과 같은 에러 발생. # 기존 명령어 $ streamlit hello # 새로운 명령어 $ streamlit hello --server.fileWatcherType none 기존 명령어에 아래 옵션을 붙여주면 해결. --server.fileWatcherType none https://discuss.streamlit.io/t/oserror-errno-24-inotify-instance-limit-reached/5506/5 OSError: [Errno 24] inotify instance limit reached Cheerful!! I find a solution after nearly one year. Other solution just change max_u..
https://stackoverflow.com/questions/6482889/get-random-sample-from-list-while-maintaining-ordering-of-items Get random sample from list while maintaining ordering of items? I have a sorted list, let say: (its not really just numbers, its a list of objects that are sorted with a complicated time consuming algorithm) mylist = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ,9 , 10 ] ... stackoverflow.com sample_s..
Js.Y
Y초보프로그래머