OpenCV-dlib를 사용한 안면 마스크 오버레이
OpenCV-dlib 라이브러리를 사용하여 안면 마스크 중첩 안면 마스크는 COVID-19의 확산을 막는 가장 좋은 방어 수단 중 하나 인 것으로 나타났습니다. 그러나 이것은 또한 코, 입, 턱선을 포함한 얼굴
ichi.pro
(읭 이런것도있다:Yolo mark 프로그램- Darknet - YOLO 데이타셋 만들기 http://ngmsoftware.com/bbs/board.php?bo_table=study&wr_id=34&sca=%EB%94%A5%EB%9F%AC%EB%8B%9D)
엔지엠소프트웨어
엔지엠 매크로는 복잡한 반복작업을 자동화할 수 있습니다. PC 게임, 모바일 게임을 최적으로 지원하며 모든 PC 프로그램 및 업무에 적용할 수 있습니다.
www.ngmsoftware.com
https://www.youtube.com/watch?v=Wm1DucuQk70
{
"workbench.colorTheme": "Default High Contrast",
"workbench.editor.enablePreview": false,
"python.defaultInterpreterPath": "C:\\Users\\joj10\\anaconda3\\envs\\apple\\python.exe",
"python.autoComplete.extraPaths": [
"C:/Users/joj10/anaconda3/envs/apple/Lib/",
"C:/Users/joj10/anaconda3/envs/apple/Lib/site-packages",
"C:/Users/joj10/anaconda3/Lib/",
"C:/Users/joj10/anaconda3/Lib/site-packages"
],
"python.analysis.extraPaths": [
"C:/Users/joj10/anaconda3/envs/apple/Lib/",
"C:/Users/joj10/anaconda3/envs/apple/Lib/site-packages",
"C:/Users/joj10/anaconda3/Lib/",
"C:/Users/joj10/anaconda3/Lib/site-packages"
]
}
안됨
(apple) C:\Users\joj10\anaconda3\envs\apple\Scripts>pip install retina-face
Requirement already satisfied: retina-face in c:\users\joj10\anaconda3\envs\apple\lib\site-packages (0.0.10)
깔렸다는데 왜안됨
print(sys.path)
#sys.path.append('c:/users/joj10/anaconda3/envs/apple/lib/site-packages')
pip 21.2.4 from C:\Users\joj10\anaconda3\envs\apple\lib\site-packages\pip (python 3.9) 이렇게 뜸
$ pip install --target=<conda 경로> <패키지명>
[출처] pip 설치 경로 바꾸기|
pip install --target=C:\Users\joj10\anaconda3\envs\python36\lib\site-packages retina-face
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow-gpu 2.6.0 requires absl-py~=0.10, but you have absl-py 1.0.0 which is incompatible.
tensorflow-gpu 2.6.0 requires flatbuffers~=1.12.0, but you have flatbuffers 2.0 which is incompatible.
tensorflow-gpu 2.6.0 requires gast==0.4.0, but you have gast 0.5.3 which is incompatible.
tensorflow-gpu 2.6.0 requires h5py~=3.1.0, but you have h5py 3.6.0 which is incompatible.
tensorflow-gpu 2.6.0 requires numpy~=1.19.2, but you have numpy 1.22.3 which is incompatible.
tensorflow-gpu 2.6.0 requires six~=1.15.0, but you have six 1.16.0 which is incompatible.
tensorflow-gpu 2.6.0 requires typing-extensions~=3.7.4, but you have typing-extensions 4.1.1 which is incompatible.
tensorflow-gpu 2.6.0 requires wrapt~=1.12.1, but you have wrapt 1.14.0 which is incompatible.
jupyter-server 1.13.5 requires pywinpty<2; os_name == "nt", but you have pywinpty 2.0.2 which is incompatible.
Successfully installed Pillow-9.0.1 PySocks-1.7.1 absl-py-1.0.0 astunparse-1.6.3 beautifulsoup4-4.10.0 cachetools-5.0.0 certifi-2021.10.8 charset-normalizer-2.0.12 colorama-0.4.4 filelock-3.6.0 flatbuffers-2.0 gast-0.5.3 gdown-4.4.0 google-auth-2.6.2 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 grpcio-1.44.0 h5py-3.6.0 idna-3.3 importlib-metadata-4.11.3 keras-2.8.0 keras-preprocessing-1.1.2 libclang-13.0.0 markdown-3.3.6 numpy-1.22.3 oauthlib-3.2.0 opencv-python-4.5.5.64 opt-einsum-3.3.0 protobuf-3.19.4 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.27.1 requests-oauthlib-1.3.1 retina-face-0.0.10 rsa-4.8 setuptools-61.2.0 six-1.16.0 soupsieve-2.3.1 tensorboard-2.8.0 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorflow-2.8.0 tensorflow-io-gcs-filesystem-0.24.0 termcolor-1.1.0 tf-estimator-nightly-2.8.0.dev2021122109 tqdm-4.63.1
typing-extensions-4.1.1 urllib3-1.26.9 werkzeug-2.1.0 wheel-0.37.1 wrapt-1.14.0 zipp-3.7.0
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\certifi already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\distutils-precedence.pth already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\pkg_resources already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\setuptools already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\wheel already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\_distutils_hack already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\joj10\anaconda3\envs\python36\lib\site-packages\__pycache__ already exists. Specify --upgrade to force replacement.
어짜고저짜고 뭐많이깔더만 저에러가 뜸
>> 아나콘다 다시깔고 파이참으로 하니 어찌저찌 실행은 된다ㅠㅠㅠ뭔가 vscode설정할때 문제가있었던듯ㅇㅇ
import matplotlib.pyplot as plt
from retinaface import RetinaFace
#print(os.getcwd())
img_path = "/dataset/dataTest/test1.jpg"
faces = RetinaFace.extract_faces(img_path= img_path, align= True)
for face in faces:
plt.imshow(face)
plt.show()
import cv2
import matplotlib.pyplot as plt
from retinaface import RetinaFace
#print(os.getcwd())
img_path = "/dataset/dataTest/ori/test1.jpg"
img = cv2.imread(img_path)
obj = RetinaFace.detect_faces(img_path)
#len(obj.keys()) >> 사진에 얼굴수대로 나옴. 한명이라 face_1
for key in obj.keys():
identity = obj[key]
print(identity)
facial_area = identity['facial_area']
#cv2.rectangle(img, pt1(x,y:시작점), pt2(x,y:종료점), color, thickness)
cv2.rectangle(img, (facial_area[2], facial_area[3]),(facial_area[0], facial_area[1]),(255, 255, 255), 1)
plt.figure(figsize = (20, 20))
plt.imshow(img[:,:,: :-1])
plt.show()
from deepface import DeepFace
img_path = "/dataset/dataTest/ori/test1.jpg"
# face recognition
# 사진두개 너혹, 결과돌리면 obj['verified']값이 true or false 나올거
obj = DeepFace.verify(img1_path=img_path, img2_path='img2.jpg', model_name='ArcFace', detector_backend='retinaface')
여기저기 오류뜨고 난리남
[7] dataset 만들기 - yolo format으로 변경 (0) | 2022.03.31 |
---|---|
[5] vscode 디버깅오류 (0) | 2022.03.28 |
[4] pytorch_yolov4로 실행해보기 (0) | 2022.03.15 |
[3.1] darknet.h 파일못찾는 문제 발생 (0) | 2022.03.11 |
[3] yolov4 환경셋팅 (0) | 2022.03.11 |
댓글 영역