Skip to content

Commit

Permalink
Fix file path error
Browse files Browse the repository at this point in the history
Use absolute dir instead.
  • Loading branch information
archersmind authored and vipstone committed Jun 21, 2018
1 parent 53d9dea commit 38721b7
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions faceai/emotion.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

startTime = datetime.datetime.now()
emotion_classifier = load_model(
'classifier/emotion_models/simple_CNN.530-0.65.hdf5')
'E:\\Github\\faceai\\faceai\\classifier\\emotion_models\\simple_CNN.530-0.65.hdf5')
endTime = datetime.datetime.now()
print(endTime - startTime)

@@ -23,9 +23,9 @@
6: '平静'
}

img = cv2.imread("img/emotion/emotion.png")
img = cv2.imread("E:\\Github\\faceai\\faceai\\img\\emotion\\emotion.png")
face_classifier = cv2.CascadeClassifier(
"C:\Python36\Lib\site-packages\opencv-master\data\haarcascades\haarcascade_frontalface_default.xml"
"F:\\Python3.6.5\\Lib\\site-packages\\opencv-master\\data\\haarcascades\\haarcascade_frontalface_default.xml"
)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_classifier.detectMultiScale(
6 changes: 3 additions & 3 deletions faceai/gender.py
Original file line number Diff line number Diff line change
@@ -6,16 +6,16 @@
import numpy as np
import chineseText

img = cv2.imread("img/gather.png")
img = cv2.imread("E:\\Code\\Python\\img\\gather_2.jpg")
face_classifier = cv2.CascadeClassifier(
"C:\Python36\Lib\site-packages\opencv-master\data\haarcascades\haarcascade_frontalface_default.xml"
"F:\\Python3.6.5\\Lib\\site-packages\\opencv-master\\data\\haarcascades\\haarcascade_frontalface_default.xml"
)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_classifier.detectMultiScale(
gray, scaleFactor=1.2, minNeighbors=3, minSize=(140, 140))

gender_classifier = load_model(
"classifier/gender_models/simple_CNN.81-0.96.hdf5")
"E:\\Github\\faceai\\faceai\\classifier\\gender_models\\simple_CNN.81-0.96.hdf5")
gender_labels = {0: '女', 1: '男'}
color = (255, 255, 255)

0 comments on commit 38721b7

Please sign in to comment.