sejongresearch / faceidentification Goto Github PK
View Code? Open in Web Editor NEW페이스타임 팀, 얼굴 인식기 (2019)
페이스타임 팀, 얼굴 인식기 (2019)
위 학습 코드를 기반으로
코드를 돌리면 밑에 첨부한 파일과 같은 배열 형태가 나오는데 저장을위해 실습을 참고하여 학습모델을 저장하였는데 저장형태가 달라서 그런지 오류가 뜹니다ㅜㅜ 어떻게 저장해야될지 모르겠어요 ㅠㅡㅠㅠㅡㅠㅡㅠㅡㅠㅡㅠㅡㅠ
saver = tf.train.Saver()
path = '/content/gdrive/My Drive/Colab Notebooks/김고은saved.cpkt'
save_path = saver.save(database,path)
import face_recognition
import cv2
import numpy as np
import glob
import os
import logging
IMAGES_PATH = 'gdrive/My Drive/dataset/김고은' # put your reference images in here
CAMERA_DEVICE_ID = 0
MAX_DISTANCE = 0.6 # increase to make recognition less strict, decrease to make more strict
def get_face_embeddings_from_image(image, convert_to_rgb=False):
"""
Take a raw image and run both the face detection and face embedding model on it
"""
# Convert from BGR to RGB if needed
if convert_to_rgb:
image = image[:, :, ::-1]
# run the face detection model to find face locations
face_locations = face_recognition.face_locations(image)
# run the embedding model to get face embeddings for the supplied locations
face_encodings = face_recognition.face_encodings(image, face_locations)
return face_locations, face_encodings
def setup_database():
"""
Load reference images and create a database of their face encodings
"""
database = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
for filename in glob.glob(os.path.join(IMAGES_PATH, '*.jpg')):
# load image
image_rgb = face_recognition.load_image_file(filename)
#key와 value반환
# use the name in the filename as the identity key
identity = os.path.splitext(os.path.basename(filename))[0]
#os.path.splitext(filename) > 확장자만 따로 분류한다.(리스트로 나타낸다)
#os.path.basename(filename) > 파일이름만 출력을 한다.
# get the face encoding and link it to the identity
locations, encodings = get_face_embeddings_from_image(image_rgb)
database = np.vstack([database, encodings])
return database
database = setup_database()
print('database=', database)
표정 분류기보단 인물 분류기가 데이터셋을 직접 모아 가공하고 학습하는 부분에서 더 적합하다고 생각했다. 또한 인물 분류기가 우리의 일상생활에서 더 유용하게 사용 될 것 같아 주제를 변경하게 되었다.
<일상생활에서의 응용>
얼굴인식을 통한 자동 출석체크는 교수님이 일일이 출석을 부르기 힘든 대형강의 나 부정출석, 대리출석을 방지하기 위해 사용되면 좋을 것 같다.
개인정보 보호 프로그램은 노트북을 통해 중요한 업무를 보거나 은행관련 업무 등 타인에게 노출되면 안되는 정보들을 확인하는 경우가 많은 요즘 시대에 다른 사람에게 정보를 노출시키지 않기 위해 사용되면 어떨까 하여 이 주제를 선정하게 되었다.
김연우 : 깃허브 관리, 전반적인 코드작성 (opencv로 웹캠 작동하기, face_recognition 사용 이미지 읽어오기, 수집한 데이터셋과 비교하여 학습 및 분류하기 코드,이미지를 데이터 가공하는 코드 등)
송민주 : 데이터수집 , 사람 인식하기,open cv 로 카메라 작동하기,깃허브 관리
백소현 :데이터 수집, 이미지를 데이터로 변경 및 분류 코드 작성, 학습 이미지와 테스트 이미지 비교 코드, cost와 정확도 학습 코드
이세정 : opencv로 웹캠 작동하기,사람 인식하기,이미지데이터 불러오기,이미지(데이터)분류,비교
사진 데이터로 여러 인물의 얼굴을 학습시켜 카메라에 비춰지는 인물의 얼굴을 식별하는 프로그램의 응용
카메라를 사용하여 사람의 얼굴을 인식하고 사전에 수집한 데이터의 학습을 토대로 인물을 분류하여 인식된 사람이 누구인지 알아낸다. 이를 응용하여 인식된 사람의 이름을 엑셀에 연동해 자동으로 출석체크가 가능하게 하는 카메라를 활용한 출석체크 프로그램.
특정 인물이 아닌 다른 사람이 카메라에 인식될 때 노트북으로 보고있던 개인용무 창을 자동으로 다른 창으로 바꿔주는 개인정보 자동 보호 프로그램.
얼굴을 인식하여 자동으로 페이스북 태그, 사진앨범 분류, face ID 로 잠금화면 해제 등의 개발 사례가 있다.
Github repository URL : https://github.com/facetimee/facetime/blob/master/README.md
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.