반응형

개발 기록/Coding&Debugging 9

MMCV, MMDetection에 적응하기

Document를 처음부터 정독하는것은 오래 걸릴 거 같아서, 필요할 떄마다 찾아서 여기에 정리해두려고 한다. MMCV 의 Registry (tistory.com) MMCV 의 Registry https://mmcv.readthedocs.io/en/latest/understand_mmcv/registry.html Registry — mmcv 1.3.16 documentation Registry MMCV implements registry to manage different modules that share similar functionalities, e.g., backbones, head, and necks, in detectors. Mos better-tomorrow.tistory.com

Implementation of Weights in 'Understanding Imbalanced Semantic Segmentation Through Neural Collapse' : 가중치 구현 해결!

'Understanding Imbalanced Semantic Segmentation Through Neural Collapse'의 code가 아직 공개되지 않아서, 구현을 시도하던 중, 다음 수식을 구현하는데에서 문제가 있었다. 다른 방정식을 통한 풀이가 있을까 싶어서 찾다가, 딱히 방법이 없다싶어서 다음과 같이 optimization problem으로 구성해서 해결을 시도했다. import torch import numpy as np def objective_function(W, num_classes=20): """ Define the objective function. The objective is to make the dot product of columns of W with themselves ..

[OpenCV / PIL] 'int' object is not subscriptable Error

Problem OpenCV로 촬영 혹은 가져온 사진을 PIL을 이용해서 가공하려고하면 에러가 뜬다. 아마 int is not subscriptable이라고 뜰 것이다. 일부러 일으켜보니 'int' object is not subscriptable 이었다. Solution 이를 해결하기 위해서는 opencv 이미지 자료형을 PIL에 맞도록 변환해야하는데, 이를 위해서는 두 가지 과정을 거쳐야한다. img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) img=Image.fromarray(img) BGR을 RGB로 순서를 바꿔주고, PIL.Image.fromarray(img)로 PIL에 맞는 자료형으로 변환한다. 정리 소스코드 총집본?은 다음과 같다. 아, 참고로 기존에 ..

[VSCode 에러] The Python path in your debug configuration is invalid.

Ctrl + Shift + P를 눌러서 Python: Select Interpreter 선택한 후, 원하는 버전의 파이썬 인터프리터를 선택하면 되는데,,,, 난 안된다 왜지?? 검색해보니 위의 작업을하면 settings.json 파일이 생성되어야하는데, 그러지 아니하였다. 작업폴더가 여러개여서 생기는 문제인 것 같아 작업 폴더를 하나로 줄여보니 바로 해결되었다. vscode는 기본적으로 작업 폴더를 하나로 지정해야 에러가 덜 뜨는 것 같다.

라즈베리 파이에서 cv2.waitKey 무반응 에러

OpenCV waitKey 함수 간단 설명 : 네이버 블로그 (naver.com) OpenCV waitKey 함수 간단 설명 waitKey( 키 입력 대기 시간 ms) 키 입력 대기 시간 함수 매개 변수로 넣는 키 입력 대기 시간은 ms 단위... blog.naver.com import cv2 frameWidth = 640 frameHeight = 480 cap = cv2.VideoCapture(0) cap.set(3, frameWidth) # Width cap.set(4, frameHeight) # Height cap.set(10, 150) # Brightness while True: success, img = cap.read() cv2.imshow("",img) if cv2.waitKey(0) and..

아두이노 컴파일 시 error: cannot convert 'USBSerial*' to 'HardwareSerial*' in assignment 문제

error: cannot convert 'USBSerial*' to 'HardwareSerial*' in assignment 최근 팀프로젝트를 하는 중, 아두이노에서 .ino파일과 .cpp, .h 파일을 동시에 컴파일 하는 일이 있었다. 그런데 이런 에러가 떴다. In file included from /home/pjs/Arduino/libraries/Rosserial_Arduino_Library/src/ros.h:39:0, from /tmp/arduino_modified_sketch_218835/h_Position.ino:20: /home/pjs/Arduino/libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h: In constructor 'Ardui..

구름 IDE에 임베디드 개발환경 설치하기 (도전! 임베디드 OS 만들기)

사지방 컴퓨터는 종료마다 초기화된다. AWS는 돈이 아깝다. 하모니카 리눅스는 터미널이 막혀있다. 이럴거면 왜 리눅스를 쓰는지? 대체 군대에서 안정적이게 임베디드 리눅스 개발환경을 구성하려면 어떻게해야하는걸까 고민한결과 구름 IDE를 사용하기로 결정했다. 구름 IDE에서 무료로 제공하는 컨테이너의 운영체제가 Ubuntu 18.04(64bit)이다. 게다가 CLI를 지원해준다. 이를 이용해서 구름 IDE에 임베디드 개발환경을 설치해볼 수 있지 않을까하는 상상을 해보았고, 실제로 해냈다. 참고 도서 : 도전! 임베디드 OS 만들기 원문 : kldp.org/node/90203 과정은 대체로 도서 혹은 원문에 나와있으므로, 오류가 잘 생기는 곳 혹은 원문과의 개발환경 차이로 인해 추가적으로 입력해야하는 명령어 ..

반응형