This commit is contained in:
Pei-Yun Sun 2020-10-20 00:04:11 +11:00
parent 22e1a348a8
commit d3d33436a1
4 changed files with 42 additions and 35 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -65,7 +65,7 @@ class DeepFaceLite(object):
for i in range(0, len(emotion_labels)):
emotion_label = emotion_labels[i]
emotion_prediction = 100 * emotion_predictions[i] / sum_of_predictions
emotion[emotion_label] = emotion_prediction
all_emotions[emotion_label] = emotion_prediction
emotion = {
'all': all_emotions,

View File

@ -670,7 +670,6 @@ def preprocess_face(base_img, enforce_detection=True, detector_backend='opencv')
img_gray = cv2.resize(img, target_size)
img_gray = cv2.cvtColor(img_gray, cv2.COLOR_BGR2GRAY)
img_pixels_gray = image.img_to_array(img_gray)
print(img_pixels_gray.shape)
img_pixels_gray = np.expand_dims(img_pixels_gray, axis=0)
img_pixels_gray /= 255 # normalize input in [0, 1]
pixels_gray.append(img_pixels_gray)

File diff suppressed because one or more lines are too long