분류 전체보기

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..
https://stackoverflow.com/questions/75409654/python-valueerror-the-truth-value-of-an-array-with-more-than-one-element-is-am Python, ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() My question is related to the answer to my previous question. the difference between the code in the previous solutions and the current code on this question is a..
https://stackoverflow.com/questions/41171191/tqdm-progressbar-and-zip-built-in-do-not-work-together tqdm progressbar and zip built-in do not work together tqdm is a Python module to easily print in the console a dynamically updating progressbar. For example from tqdm import tqdm from time import sleep for _ in tqdm(range(10)): sleep(0.1) pri... stackoverflow.com zip이나 enumerate는 length가 보이지 않기때문..
opencv-python 외에 추가로 contrib도 설치해야 함. pip install opencv-contrib-python
docker 내 container에서 특정 모델을 돌리다 터미널 안에선 오류가 나서 중단되는데, 간혹 그 프로세스가 Nan과 같은 쓰레기 프로세스로 남아있는 경우가 있다. 이럴 경우 container로 접속하지 않고 메인 사용자 계정으로 nvidia-smi를 켜서 PID를 확인하게 되는데, 간혹 nvidia-smi로 봐도 PID가 뜨지 않고, htop이나 nvtop으로만 PID가 보이는 경우가 존재한다. 근데 이렇게 어렵게 발견한 PID로 process kill을 시도할 경우, "No such process"라고 뜨면서 해당 process를 종료할 수 없는 경우가 존재하는데, 이는 docker container 안에서의 PID와 실 server 내 PID가 다르면서 생기는 이슈이다. bash: kill:..
단순히 내 용도로 다른 블로그에 있던 tmux 명령어 정리 세션 관련 명령어tmux ls : 현재 동작하는 세션 listup# 새로운 세션 생성 (with window 지정)$ tmux new -s $SESSION_NAME (-n $ WINDOW_NAME)# 세션 명 변경 Modify Session Namectrl + b, $# 세션 종료 Terminate se..
from urllib.parse import unquote # 디코딩할때 from urllib.parse import quote # 인코딩할때 text = '%ED%85%8C%EC%8A%A4%ED%8A%B8%EB%AC%B8%EC%9E%A5' print(unquote(text)) >>> "테스트문장" str = "테스트문장" print(quote(str)) >>> '%ED%85%8C%EC%8A%A4%ED%8A%B8%EB%AC%B8%EC%9E%A5' 도움주신 출처 : 링크 [웹크롤링] 한글 URL 인코딩/디코딩 (URL Encoding/Decoding) 🔍 예상 검색어 더보기 # 한글 URL 인코딩 # 한글을 URL 인코딩하기 # URL 인코딩 문자열 한글로 변환하기 # 한국어 URL 인코딩 변환하는 법 #..
통상적으로 glob이나 os.listdir로 파일 리스트를 정리하고, 이를 sorting해주면 아래와 같이 정렬된다. 파일명을 문자열로 인식하기 때문에 아래처럼 정렬되는데, 이를 natsort라는 python package로 정렬해주면 우리가 원하는 파일 정렬이 가능하다. 3. natsort API — natsort 8.2.0 documentation out – The sequence ordered by index, as a list or as an iterator (depending on the value of iter). natsort.readthedocs.io # 기존 방식 sorted(file_list) """ file_1.jpg file_10.jpg file_11.jpg file_12.jpg f..
[ WARN:0@14.442] global loadsave.cpp:244 findDecoder imread_('./이미지/img.jpg'): can't open/read file: check file path/integrity 해결법 : numpy로 기존 string을 변경해준다. img_array = np.fromfile(full_path, np.uint8) img = cv2.imdecode(img_array, cv2.IMREAD_COLOR) 도움 주신 출처 : https://velog.io/@hyesukim1/%EC%98%A4%EB%A5%98cant-openread-file-check-file-pathintegrity-cv2.Imread-%EB%AA%BB%EC%9D%BD%EC%96%B4%EC%98%A..
파일들이 있는 폴더로 들어가서 아래 명령어 실행. for file in *; do mv "$file" `echo $file | tr ' ' '_'`; done 그럼 기존 띄어쓰기가 있던 파일이 일괄적으로 _로 변경됨 ex) "샘플 이미지.jpg" >> "샘플_이미지.jpg" https://www.linuxadictos.com/ko/reemplazar-espacios-por-guiones-bajos.html 파일 이름의 공백을 밑줄로 바꾸는 방법 공백이있는 이름으로 콘솔이나 터미널에서 작업 할 때 문제가있는 사람 중 하나입니다. 왜냐하면 이것을 읽으면 그만두 게 될 것이기 때문입니다. www.linuxadictos.com - 파일명에 번호 붙이기 ls -v | cat -n | while read n f; ..
https://aihints.com/how-to-draw-bounding-box-in-opencv-python/ How to Draw Bounding Box in OpenCV Python - AiHints You can draw a bounding box in OpenCV Python by following the given steps. Import the OpenCV library. Now read the image from the location. aihints.com 이미지 내 특정 그림을 포함하는 bbox만을 남겨두고, 나머지는 crop해버리는 코드 def make_inner_crop(): # target_lst is list of cropped image, # we're going to remo..
Js.Y
'분류 전체보기' 카테고리의 글 목록 (4 Page)