본문 바로가기

8. OpenCV | CV

(14)
8/22(화) IT K-DT(121일차) / 8.Segmentation(YoloV8) 8. Segmentaion 8-1. Segmentation 영상을 여러 부분으로 나누는 프로세스 Segmentation에 대한 설명 웹페이지: https://www.v7labs.com/blog/panoptic-segmentation-guide Panoptic Segmentation: Definition, Datasets & Tutorial [2023] Panoptic segmentation is the task of simultaneously segmenting objects and classifying them into categories. Discover different approaches to the task. www.v7labs.com 1) Semantic Segmentation 이미지의 각 픽..
8/11(금) IT K-DT(110일차) / 7.Object Detection(YoloV5) 7.Object Detection(YoloV5) 7-1. 실습 데이터 준비 Pascal VOC 2007 분류와 객체 검출을 위해 만들어진 데이터셋. 객체 분할도 가능하지만, 더 최신 버전의 데이터셋을 사용 권장함. http://host.robots.ox.ac.uk/pascal/VOC/index.html 클래스: 총 20개 Person: person Animal: bird, cat, cow, dog, horse, sheep Vehicle: aeroplane, bicycle, boat, bus, car, motorbike, train Indoor: bottle, chair, dining table, potted plant, sofa, tv/monitor 학습데이터 train: 2501장 val: 2510장 ..
8/8(화) IT K-DT(107일차) / 6.YoloV1 실습 # 1. 필요한 모듈 및 라이브러리 설치 !pip install albumentations import os import cv2 import torch import numpy as np import albumentations as A import pandas as pd import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') import torchvision import torch.nn as nn from ipywidgets import interact from torch.utils.data import DataLoader from torchvision import models, transforms from torc..
8/7(월) IT K-DT(106일차) / 5.FasterR-CNN실습 (2) phase = 'train' model.train() # train모드 아래 dloader의 phase를 가져와서 index, batch로 나눠서 순회 후 처리 for index, batch in enumerate(dloaders[phase]): images = batch[0] # batch에 들어온 값: images, targets, filenames targets = batch[1] filenames = batch[2] images = list(image for image in images) # list화해서 images에 담아줌 # target의 t만큼 items를 꺼내서 key와 value를 dict형태로 만들어 list로 묶음. # list안에 dict가 여러 개 들어가있는 형태 targets ..
8/4(금) IT K-DT(105일차) / 5.FasterR-CNN실습 (1) 5. Faster R-CNN 실습 버스, 트럭 등의 차량이 지나가는 영상에 인식 개체에 네모 박스를 구현 // 아래: 예시 사진 # 필요한 라이브러리와 모듈 설치 import os import cv2 import torch import numpy as np import pandas as pd import matplotlib.pyplot as plt from ipywidgets import interact from torch.utils.data import DataLoader from torchvision import models, transforms from torchvision.utils import make_grid from torchvision.models.detection.faster_rcnn i..
8/3(목) IT K-DT(104일차) / 4.ObjectDetection 4. Object Detection(객체 탐지) 4-1. Object Detection(객체 탐지) 컴퓨터비전과 이미지처리와 관련된 컴퓨터기술. 디지털이미지와 비디오로 특정한 계열의 Sementic Instance를 감지하는 행위. 얼굴검출, 보행자검출 등이 포함됨 4-1-1. 컴퓨터 비전의 Task 비교 Image Classification: 이미지에 있는 개체 범주 목록을 생성해서 구별 Single-Object Localization: 이미지에 있는 개체 범주 목록과 각 개체 범주의 한 인스턴스의 위치와 배열을 나타내는 bounding box 생성. https://machinelearningmastery.com/object-recognition-with-deep-learning A Gentle Int..
8/2(수) IT K-DT(103일차) / 3.Classification실습 폐 사진을 보고 1. 일반인의 폐, 2. 코로나에 걸린 사람의 폐, 3. 폐렴에 걸린 사람의 폐를 구별하는 코드 작성해보기 (VGG19(classification) 모델 사용 / Dataset, DataLoader, Train/Test 클래스화 / Test셋에 대한 예측 및 결과를 시각화) 가상환경 생성 * python이 2개가 설치되어있기 때문에 env 가상환경을 만들어서 실행해주는것이 좋음 cmd 경로를 지정한 후, 터미널에 작성 pip install pipenv 2개 이상의 python이 설치되어있을 때, 가상환경을 사용하고자하는 python의 버전을 입력 여기서는 3.8버전의 python을 사용할 예정 pipenv --python 3.8 가상환경의 이름 생성 pipenv shell 커널의 설치 p..
8/1(화) IT K-DT(102일차) / 1.데이터셋~2.Classification 1. 데이터셋 1-1. 데이터셋 기계 학습 모델을 학습하는데 사용되는 데이터의 모음. 데이터셋은 이미지, 오디오, 텍스트, 수치데이터 등 다양한 데이터형으로 구성될 수 있음. 특정 데이터 유형과 데이터셋의 크기는 해결되는 문제와 사용중인 모델 유형에 따라 달라짐. 1-1-1. 데이터셋의 크기 모델이 학습 중에 본 예제의 수. 적은 데이터셋: 다양한 예제가 포함되지 않아 과적합이 발생할 수 있음. 큰 데이터셋: 모델이 충분한 수의 예제를 보고 새 데이터로 일반화할 수 있음. → 그래서 데이터는 항상 많아야 함. 1-1-2. 데이터의 품질 주석이나 레이블이 잘못 지정된 데이터셋 → 모델의 성능에 부정적인 영향을 줄 수 있음. 다양한 개체 변형의 존재, 조건, 배경 등을 포함한 데이터셋의 다양성도 모델의 견고..