반응형 opencv2 [Python] Image 읽는 방법 1. PIL # pip install Pillow from PIL import Image img_path = "test_img.jpg" img = Image.open(img_path) #-- "RGB"로 불러오고 싶을 경우 img = Image.open(img_path).convert("RGB") 2. Opencv opencv를 활용해서 이미지를 불러오면 "RGB"가 아니라 "BGR" 형태로 불러오는것을 확인 할 수 있다. 이를 RGB 형태의 배열로 변환해서 이미지를 확인하는 것을 추천한다. # pip install opencv-python import cv2 img_path = "test_img.jpg" img = cv2.imread(img_path) #-- BGR 형태의 배열을 RGB 형태의 배열로 .. 2023. 2. 10. [CV] Detectron2 모델 환경 설정 detectron2 모델 환경 설정 1. ubuntu 환경 확인 (base) ➜ ~ lsb_release -a 2. python 버전 3.8로 detectron_env 이름을 가진 가상환경을 하나 만들어준다. (base) ➜ conda create -n detectron_env python=3.8 (base) ➜ conda activate detectron_env # 가상환경 활성화 3. detectron2 github에서 git clone을 실행하고 폴더 경로로 들어간다. (detectron_env) ➜ git clone https://github.com/facebookresearch/detectron2.git (detectron_env) ➜ cd detectron2 4. detectron_env 가상.. 2023. 1. 11. 이전 1 다음 반응형