mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
fix bug
This commit is contained in:
parent
3b4241f165
commit
5af2071aa0
BIN
src/__pycache__/config.cpython-38.pyc
Normal file
BIN
src/__pycache__/config.cpython-38.pyc
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_mongoengine import MongoEngine
|
from flask_mongoengine import MongoEngine
|
||||||
from deepface import DeepFaceLite
|
from deepface.DeepFaceLite import DeepFaceLite
|
||||||
# import tensorflow as tf
|
# import tensorflow as tf
|
||||||
# from tensorflow.python.keras.backend import set_session
|
# from tensorflow.python.keras.backend import set_session
|
||||||
import os
|
import os
|
||||||
|
BIN
src/controller/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
src/controller/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
src/controller/__pycache__/feedback_controller.cpython-38.pyc
Normal file
BIN
src/controller/__pycache__/feedback_controller.cpython-38.pyc
Normal file
Binary file not shown.
BIN
src/controller/__pycache__/general_controller.cpython-38.pyc
Normal file
BIN
src/controller/__pycache__/general_controller.cpython-38.pyc
Normal file
Binary file not shown.
BIN
src/controller/__pycache__/prediction_controller.cpython-38.pyc
Normal file
BIN
src/controller/__pycache__/prediction_controller.cpython-38.pyc
Normal file
Binary file not shown.
@ -62,9 +62,9 @@ class DeepFaceLite(object):
|
|||||||
|
|
||||||
all_emotions = {}
|
all_emotions = {}
|
||||||
|
|
||||||
for i in range(0, len(emotion_labels)):
|
for j in range(0, len(emotion_labels)):
|
||||||
emotion_label = emotion_labels[i]
|
emotion_label = emotion_labels[j]
|
||||||
emotion_prediction = 100 * emotion_predictions[i] / sum_of_predictions
|
emotion_prediction = 100 * emotion_predictions[j] / sum_of_predictions
|
||||||
all_emotions[emotion_label] = emotion_prediction
|
all_emotions[emotion_label] = emotion_prediction
|
||||||
|
|
||||||
emotion = {
|
emotion = {
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -138,14 +138,16 @@ def detect_face(img, detector_backend='opencv', enforce_detection=True):
|
|||||||
|
|
||||||
# drawing settings
|
# drawing settings
|
||||||
font = ImageFont.truetype(font='font/FiraMono-Medium.otf',
|
font = ImageFont.truetype(font='font/FiraMono-Medium.otf',
|
||||||
size=np.floor(3e-2 * img.size[1] + 0.5).astype('int32'))
|
size=np.floor(2e-2 * img.size[1] + 0.5).astype('int32'))
|
||||||
thickness = (img.size[0] + img.size[1]) // 300
|
thickness = (img.size[0] + img.size[1]) // 300
|
||||||
hsv_tuples = [(x / 50, 1., 1.)
|
|
||||||
for x in range(50)]
|
# # colors
|
||||||
colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), hsv_tuples))
|
# hsv_tuples = [(x / 50, 1., 1.)
|
||||||
colors = list(
|
# for x in range(50)]
|
||||||
map(lambda x: (int(x[0] * 255), int(x[1] * 255), int(x[2] * 255)), colors))
|
# colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), hsv_tuples))
|
||||||
np.random.shuffle(colors) # Shuffle colors to decorrelate adjacent classes.
|
# colors = list(
|
||||||
|
# map(lambda x: (int(x[0] * 255), int(x[1] * 255), int(x[2] * 255)), colors))
|
||||||
|
# np.random.shuffle(colors) # Shuffle colors to decorrelate adjacent classes.
|
||||||
|
|
||||||
|
|
||||||
# keep PIL image and cv2 image
|
# keep PIL image and cv2 image
|
||||||
@ -205,12 +207,12 @@ def detect_face(img, detector_backend='opencv', enforce_detection=True):
|
|||||||
for i in range(thickness):
|
for i in range(thickness):
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[left + i, top + i, right - i, bottom - i],
|
[left + i, top + i, right - i, bottom - i],
|
||||||
outline=colors[i])
|
outline='blue')
|
||||||
|
|
||||||
if showid:
|
if showid:
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[tuple(text_origin), tuple(text_origin + label_size)],
|
[tuple(text_origin), tuple(text_origin + label_size)],
|
||||||
fill=colors[i]
|
fill='blue'
|
||||||
)
|
)
|
||||||
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
||||||
del draw
|
del draw
|
||||||
@ -325,12 +327,12 @@ def detect_face(img, detector_backend='opencv', enforce_detection=True):
|
|||||||
for i in range(thickness):
|
for i in range(thickness):
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[left + i, top + i, right - i, bottom - i],
|
[left + i, top + i, right - i, bottom - i],
|
||||||
outline=colors[i])
|
outline='blue')
|
||||||
|
|
||||||
if showid:
|
if showid:
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[tuple(text_origin), tuple(text_origin + label_size)],
|
[tuple(text_origin), tuple(text_origin + label_size)],
|
||||||
fill=colors[i]
|
fill='blue'
|
||||||
)
|
)
|
||||||
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
||||||
del draw
|
del draw
|
||||||
@ -391,12 +393,12 @@ def detect_face(img, detector_backend='opencv', enforce_detection=True):
|
|||||||
for i in range(thickness):
|
for i in range(thickness):
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[left + i, top + i, right - i, bottom - i],
|
[left + i, top + i, right - i, bottom - i],
|
||||||
outline=colors[i])
|
outline='blue')
|
||||||
|
|
||||||
if showid:
|
if showid:
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[tuple(text_origin), tuple(text_origin + label_size)],
|
[tuple(text_origin), tuple(text_origin + label_size)],
|
||||||
fill=colors[i]
|
fill='blue'
|
||||||
)
|
)
|
||||||
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
||||||
del draw
|
del draw
|
||||||
@ -452,12 +454,12 @@ def detect_face(img, detector_backend='opencv', enforce_detection=True):
|
|||||||
for i in range(thickness):
|
for i in range(thickness):
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[left + i, top + i, right - i, bottom - i],
|
[left + i, top + i, right - i, bottom - i],
|
||||||
outline=colors[i])
|
outline='blue')
|
||||||
|
|
||||||
if showid:
|
if showid:
|
||||||
draw.rectangle(
|
draw.rectangle(
|
||||||
[tuple(text_origin), tuple(text_origin + label_size)],
|
[tuple(text_origin), tuple(text_origin + label_size)],
|
||||||
fill=colors[i]
|
fill='blue'
|
||||||
)
|
)
|
||||||
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
draw.text(text_origin, label, fill=(0, 0, 0), font=font)
|
||||||
del draw
|
del draw
|
||||||
|
File diff suppressed because one or more lines are too long
BIN
src/extension/__pycache__/constants.cpython-38.pyc
Normal file
BIN
src/extension/__pycache__/constants.cpython-38.pyc
Normal file
Binary file not shown.
BIN
src/extension/__pycache__/utilServices.cpython-38.pyc
Normal file
BIN
src/extension/__pycache__/utilServices.cpython-38.pyc
Normal file
Binary file not shown.
BIN
src/views/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
src/views/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
src/views/__pycache__/public_route.cpython-38.pyc
Normal file
BIN
src/views/__pycache__/public_route.cpython-38.pyc
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user