본문 바로가기

딥러닝 컴퓨터 비전

(11)
코랩 GPU서버 유지 function ClickConnect(){ console.log("Working"); document.querySelector("colab-toolbar-button").click() }setInterval(ClickConnect, 1800000)
얼굴인식 Face Detection - 사진 한장에서 얼굴의 위치가 어디인지 알아내는 방법 Face Tracking - 동영상에서 얼굴 탐지를 한번 하고 추적 알고리즘을 통해 따라다니게 하는 방법 Face Recognition - 한장의 사진을 이미 알고있는 상태에서 새로운 사진에서 누구인지 알아내기
YOLO v5 커스텀 학습 튜토리얼 1. (https://public.roboflow.com/object-detection/pistols) 1) product -> datasets click 2) object detection 3) 원하는 dataset imges 다운로드 4) YOLO v5 PyTorch -> show download code 5) jupyter -> 복사 2. Colab 1) 새로운 파일 생성 2) GPU 설정 3) 1번에서 복사한 URL 다운로드 4) label 폴더는 (clas x y width height) 로 구성 (txt파일) 5) new folder (dataset) 6) download받은거 전부 넣어주기 %cd /content !git clone https://github.com/ultralytics/yo..
keras-yolo3 패키지를 이용하여 Yolo 기반 이미지/영상 Detection - Darknet에서 Pretrained된 yolo weights 모델 다운로드 - keras-yolo3에서 사용할 수 있는 weight 파일로 변환 0. keras-yolo3 패키지 다운로드 %cd /content/DLCV/Detection/yolo !git clone https://github.com/qqwweee/keras-yolo3.git !ls -lia /content/DLCV/Detection/yolo/keras-yolo3 1. keras-yolo3 디렉토리에 있는 yolo.py에서 YOLO class를 import default_dir = '/content/DLCV'default_yolo_dir = os.path.join(default_dir, 'Detection/yolo') LOCAL_PA..
OpenCV YOLO 이미지, 영상 Detection - 함수화 def get_detected_img(cv_net, img_array, conf_threshold, nms_threshold, use_copied_array=True, is_print=True): rows = img_array.shape[0] cols = img_array.shape[1] draw_img = None if use_copied_array: draw_img = img_array.copy() else: draw_img = img_array layer_names = cv_net.getLayerNames() outlayer_names = [layer_names[i[0] - 1] for i in cv_net.getUnconnectedOutLayers()] cv_net.setInput(cv2.dnn...
OpenCV YOLO 이미지, 영상 Detection 1. 평소 하던대로 이미지 확인 import cv2 import matplotlib.pyplot as plt import os %matplotlib inline default_dir = '/content/DLCV' img = cv2.imread(os.path.join(default_dir, 'data/image/beatles01.jpg')) img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) print('image shape:', img.shape) plt.figure(figsize=(12, 12)) plt.imshow(img_rgb) 2. Darknet Yolo사이트에서 coco로 학습된 Inference모델와 환경파일을 다운로드 받은 후 이를 이용해 OpenCV에서 I..
OpenCV_FasterRCNN_Objet_Detection labels_to_names_0 = {0:'person',1:'bicycle',2:'car',3:'motorcycle',4:'airplane',5:'bus',6:'train',7:'truck',8:'boat',9:'traffic light', 10:'fire hydrant',11:'street sign',12:'stop sign',13:'parking meter',14:'bench',15:'bird',16:'cat',17:'dog',18:'h orse',19:'sheep', 20:'cow',21:'elephant',22:'bear',23:'zebra',24:'giraffe',25:'hat',26:'backpack',27:'umbrella',28:'shoe',29:'eye glasses', 30:'hand..
OpenCV DNN 패키지 이용 - OpenCV 실습은 GPU가 필요없다. 1. git clone !git clone ~~ 2. image 확인 import cv2 import matplotlib.pyplot as plt import os %matplotlib inline default_dir = '/content/DLCV' img = cv2.imread(os.path.join(default_dir,'data/image/beatles01.jpg')) img_rgb = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) print('image shape : ', img.shape) plt.figure(figsize=(12,12)) plt.imshow(img_rgb) 3. Tensorflow에서 pretrained된 Infer..
OpenCV 영상처리 개요 1. VideoCaptrue cap = cv2.VideoCapture(video_input_path) - 영상 Frame 너비 cap.get(cv2.CAP_PROP_FRAME_WIDTH) - 영상 Frame 높이 cap.get(cv2.CAP_PROP_FRAME_HEIGHT) - 영상 FPS cap.get(cv2.CAP_PROP_FPS) 2. VideoWriter vid_writer = cv2.VideoWriter(video_output_path, ... ) while True: hasFrame, img_frame = cap.read() if not hasFrame: print("더 이상 처리할 frame이 없습니다.") break; vid_writer.write(img_frame) 3. 개요 cap = ..
OpenCV 이미지 처리 1. PIL 패키지 이용하여 이미지 로드 import matplotlib.pyplot as plt import os %matplotlib inline from PIL import Image default_dir = '/content/DLCV' # 코랩은 /content 디렉토리를 기준으로 절대경로를 이용한다. pil_image = Image.open(os.path.join(default_dir, "data/image/beatles01.jpg")) # PIL은 open()으로 image file을 읽어서 # ImageFile 객체 생성 print('image type : ',type(pil_image)) plt.figure(figsize=(10,10)) # 아직 figure함수에 대해서 잘 모르겠다. pl..