Tech & Development
YOLOv5 - Custom Data로 학습하기
YOLOv5 - Custom Data로 학습하기
2022.02.14Object Detection이란? Classification 과 Localization 이 동시에 수행되는 것을 의미합니다. 즉 이미지에서 찾고자 하는 객체의 위치를 찾아내고 찾은 객체의 인스턴스(사람, 자동차, 동물 등)를 분류하는 일을 의미합니다. Object detection은 현재 수많은 컴퓨터 비전 분야에서 응용되고 있습니다. 사실 Object detection에 대한 연구는 Deep Learning이 유형을 끌기 훨씬 전부터 진행되고 있었습니다. 이전 글에서 소개한 Haar Cascades 를 이용한 얼굴 인식방법이나 HOG, SURF, DPM 등도 Deep Learning을 적용하기 이전 기술입니다. 2014년 이후에는 Object detection에 대한 논문이 쏟아져 나오고 있으며, 상..
UGATIT (Selfie2Anime) - 사람을 애니메이션 캐릭터로 만들기
UGATIT (Selfie2Anime) - 사람을 애니메이션 캐릭터로 만들기
2022.02.142020년에 GAN(Generative Adversarial Network) 이용하여 실제 사람을 애니메이션 스타일의 케릭터로 변화하는 모델이 소개 되었습니다. Selfie2Anime 로 더 유명하지만 실제 이름은 U-GAT-IT 입니다. 그리고 논문을 읽어보니 참여하신분들이 모두 한국분들이시네요. 모든 Source는 Github에 올려두었고 U-GAT-IT Source를 Fork하여 간단하게 테스트 할 수 있도록 일부 수정하였습니다. 먼저 수행을 하기 위해서는 predtrained model 을 다운로드 받아야 합니다. 50 epoch과 100 epoch 체크포인트가 있으며 용량이 조금 큽니다. (4GB 이상) selfie2anime checkpoint (50 epoch) selfie2anime che..
Richer Convolutional Features (RCF) for Edge Detection - 윤곽선 검출
Richer Convolutional Features (RCF) for Edge Detection - 윤곽선 검출
2022.02.09이 글에서는 RCF(Richer Convolutional Features for Edge Detection)를 이용하여 윤곽선을 검출하는 방법에 대해 소개하겠습니다. 이 알고리즘은 XuanyiLi에 의해 소개 되었습니다. 소개된 자료를 보면 성능적인 측면에서 앞서 소개한 HED (Holistically-Nested Edge Detection) 보다 좋은 것 같습니다. Method BSDS500 dataset NYUD RCF 0.819 0.781 HED 0.788 0.741 디렉토리 구조는 다음과 같이 구성했습니다. 소스코드는 Github에 있습니다. ├── detectors │ ├── rcf │ │ ├── weights │ │ │ └── only-final-lr-0.01-iter-130000.pth │ ..
Holistically-Nested Edge Detection (HED) - 윤곽선 검출
Holistically-Nested Edge Detection (HED) - 윤곽선 검출
2022.02.09Holistically-Nested Edge Detection 이 글에서는 HED (Holistically-Nested Edge Detection) 을 이용하여 윤곽선을 검출하는 방법에 대해 소개하겠습니다. 이 알고리즘은 Saining Xie에 의해 소개 되었습니다. HED는 이미지에서 물체의 경계 또는 객체 경계를 검출 할 수 있는 심층 신경망이라 소개하고 있습니다. 디렉토리 구조는 다음과 같이 구성했습니다. 소스코드는 Github에 있습니다. ├── detectors │ ├── hed │ │ ├── weights │ │ │ └── hed_pretrained_bsds.caffemodel │ │ ├── __init__.py │ │ └── deploy.prototxt │ └── __init__.py ├──..
Edge Detection with OpenCV and Deep Learning
Edge Detection with OpenCV and Deep Learning
2022.02.08이미지를 다루다보면 특정 영역의 윤곽선 검출이 필요한 경우가 있습니다. 예를들면 촬영한 문서 이미지를 스캔한 이미지 형태로 만들기 위해 가장 큰 사각형의 영역을 찾는다거나 특정 물체의 경계를 찾기도 하고 나아가 이미지를 분석하거나 패턴을 파악하기 위해서도 사용됩니다. 일반적으로 가장 많이 알려진 edge detection algorithms은 Sobel, Canny, Prewiit, Roberts, Fuzzy Logic 방법 등이 있습니다. 이미지 연산을 통한 윤곽선 검출은 임계값을 수동으로 적용해야 하는데 하나의 이미지에서 잘 적용되는 임계값은 다른 이미지에서 제대로 작동하지 않을 수 있습니다. 그리고 추출하려는 영역이 배경이미지와 대비가 잘 되지 않는 경우 윤곽선을 찾는건 매우 어렵고 복잡한 이미지 ..
[ Python ] 미디어파이프(Mediapipe) 이용한 얼굴인식
[ Python ] 미디어파이프(Mediapipe) 이용한 얼굴인식
2022.02.04미디어파이프(Mediapipe)는 구글에서 인체를 대상으로 하는 인식에 대해 다양한 형태로 기능과 모델까지 제공하는 서비스입니다. Python 이외에도 다양한 프로그램언어와 환경에서에서 사용하기 편리한 라이브러리 형태로 제공되며 설치 후 즉시 간편하게 사용이 가능합니다. 이전 글에서 소개한 dlib을 이용한 얼굴인식을 처음 사용해본건 2018년이였는데 처음 사용 했을 때 신기하기도 했고 상당히 빠르기때문에 영상에 적용하여 다양한 응용도 했었습니다. 하지만 dlib을 사용하면서 이런 부분은 조금 문제가 있어서 어려움이 있겠구나 하는 부분도 많았죠. (물론 dlib를 모두 이해하고 사용해본것은 아니지만..) 그런데 최근 MediaPipe라는 라이브러리를 사용해보고 다시 한번 놀랬습니다. MediaPipe의 ..
개발자를 위한 맥북 세팅 (Homebrew, iterm2, oh my zsh)
개발자를 위한 맥북 세팅 (Homebrew, iterm2, oh my zsh)
2022.02.031. Dock에서 불필요한 아이콘은 모두 삭제2. Homebrew 설치다양한 어플리케이션을 빠르고 편리하게 설치하기 위해서 사이트로 이동합니다. 스크립트를 복사하여 터미널에 붙여넣고 Homebrew를 설치합니다.설치가 완료되었다면 Homebrew를 통해서 어플리케이션을 각각의 웹사이트 방문없이 손쉽게 설치가 가능합니다. Homebrew로 설치가 가능한 어플리케이션을 알고 싶다면 Homebrew 사이트로 이동하여 이름을 검색하면 됩니다. (검색이 안된다면 언어를 English로 바꾸시고 검색해보세요.)3. iterm2 설치Homebrew에서 복사한 iterm2를 검색하여 Install command를 복사 후 터미널에 붙여넣어 설치를 진행합니다.4. iterm2 설정설정을 위해 iTerm을 실행합니다.Pr..
Python, OpenCV Haar Cascades를 이용한 얼굴 인식방법
Python, OpenCV Haar Cascades를 이용한 얼굴 인식방법
2022.01.282001년 Viola와 Jones가 "Rapid Object Detection using a Boosted Cascade of Simple Features" 논문에서 특징(feature) 기반의 Object 검출 알고리즘(Haar cascades)을 소개하였습니다. 근래에 많은 알고리즘(HOG + Linear SVM, SSD, Faster R-CNN, YOLO 등)이 Haar cascades보다 더 정확하지만 여전히 오늘날에도 Object 검출 연구와는 관련성이 있고 매우 유용합니다. 그리고 확실한 것은 Haar cascades 속도가 너무 빨라 그 속도를 능가하기 어렵다는 것입니다. Haar cascades는 OpenCV에서 사용이 가능하고 리소스가 제한된 환경에서 사용 있습니다. 알고리즘은 다음 4..
dlib, Python을 이용하여 강아지 얼굴 인식하는 방법
dlib, Python을 이용하여 강아지 얼굴 인식하는 방법
2022.01.24사람 얼굴을 인식하는 방법에서 조금 더 나아가 강아지의 얼굴을 인식하는 방법에 대해 알아보겠습니다. 강아지 얼굴을 인식하기 위한 모델은 tureckova 라는 분이 개발한 모델을 사용했습니다. (tureckova는 강아지가 카메라를 바라보면 얼굴을 인식하여 자동으로 저장하기 위한 프로그램을 개발하기 위한 목적이였다고 설명하고 있습니다.) 모델 파일은 링크에서 다운로드 가능합니다. (dogHeadDetector.dat, landmarkDetector.dat 파일을 다운로드 받습니다.) 아직까지 사람들은 자신의 얼굴을 인식되는 상황에 대해 거부감이 있습니다. 실제 얼굴 사진을 수집하는 것이 아니라 얼굴의 측정값이라 하더라도 말이죠. 그래서 오히려 강아지 얼굴을 인식하고 구별 할 수 있다면 유기견 문제를 해결..
dlib, Python을 이용하여 얼굴 인식하는 방법
dlib, Python을 이용하여 얼굴 인식하는 방법
2022.01.20간혹 TV나 영화를 보다보면 누가 누군인지 모를 정도로 닮아 혼란에 빠뜨리게 하는 연애인이 있습니다. 다른 연애인 도플갱어 블로그나 얼굴 인식 기술을 소개하는 자료를 보면 항상 등장하는 사람이 있는데, 바로 Will Ferrell(배우)과 Chad Smith(뮤지션) 입니다. 실제로 두 사람은 닮은 꼴로 유명해서 The Tonight Show라는 토크쇼에 출연했었습니다. 이전 글에서 얼굴을 검출하는 방법을 소개했었는데, 이번에는 얼굴 고유한 특징을 찾아 구별해내는 얼굴 인식 기술을 구현하는 방법을 소개하도록 하겠습니다. 참고 실제로 얼굴을 구별하는 단계에 이르렀습니다. 하지만 이미 얼굴 태그가 달린 사람들과 비교를 하기에는 너무 오래 걸립니다. 특히 수십억 멱의 사용자와 1조 개의 사진이 있는 Faceb..
dlib, Python을 이용하여 얼굴 검출하기
dlib, Python을 이용하여 얼굴 검출하기
2022.01.20스마트폰의 카메라를 사용해 보셨다면 한번쯤은 얼굴 인식 기능을 경험해 보셨을 겁니다. 최근 카메라의 얼굴 인식 기능은 매우 중요한 기능이 되었습니다. 얼굴을 자동으로 인식하고 초점을 맞추거나 태그를 만들어 주기도 합니다. 얼굴 인식 기술은 여러 가지 모델이 제안되었는데 OpenCV의 Harr Cascades와 dlib의 HOG (Histogram of Oriented Gradients) 가 대표적인 모델입니다. 여기서는 dlib의 HOG 방식을 사용 할 것입니다. 참고 이미지에서 얼굴을 찾기 위해 이미지를 Grayscale로 바꾸는 것부터 시작합니다. 왜냐하면 얼굴을 찾는데 색상 데이터는 필요 없기 때문입니다. 모든 단일 픽셀에 대해 이를 직접 둘러싸고 있는 픽셀을 살펴봅니다. 단일 픽셀을 둘러싸고 있는..
[ PyQt ] Qt Resource 파일 (.qrc) 적용방법
[ PyQt ] Qt Resource 파일 (.qrc) 적용방법
2022.01.18Qt Designer를 이용하여 이미지를 넣을 때 직접 이미지 파일을 선택하여 사용 할 수도 있지만 실행 파일을 만들때 오류가 발생 할 수 있습니다. 이런 경우를 대비하여 Qt 리소스 파일로 만들어 사용합니다. Qt Designer에서 리소스를 관리하는 영역은 아래와 같습니다. 1. 리소스 편집 (연필) 버튼 클릭 ▶ 새 리소스 파일 클릭 2. 리소스 파일명 입력 후 저장 클릭 3. 접두어 추가 (생량 가능) 4. 파일 추가를 클릭하여 이미지를 선택 5. 리소스 선택을 클릭하여 추가된 이미지를 사용 Qt Designer에서 리소스를 사용한 경우 PyQt uic가 리소스 import를 호출하는 디렉토리에서 리소스 파일을 찾으려 합니다. pyrcc5 를 이용하여 Qt 리소스 파일(.qrc)을 Python 모..