Skip to content
Snippets Groups Projects
Commit a5de4d73 authored by Hyunseok_Sang's avatar Hyunseok_Sang
Browse files

얼굴이 인식되지 않았을때의 None을 Return하도록 Face와 관련 클래스 수정

parent d43273c6
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,12 @@ from modules import image_processor
class Face:
def __init__(self, left, top, right, bottom) -> None:
if None in [left, top, right, bottom]:
self.left = None
self.top = None
self.right = None
self.bottom = None
else:
self.left = int(left)
self.top = int(top)
self.right = int(right)
......@@ -14,7 +20,7 @@ class FaceDataList:
self.data = face_dict_data
def getFace(self, face_number):
if type(self.data) is tuple:
return (None, None)
return Face(None, None, None, None)
face_location = self.data["face_"+str(face_number)]["facial_area"]
return Face(face_location[0], face_location[1], face_location[2], face_location[3])
......@@ -26,6 +32,7 @@ class FaceDetector:
return faceDataList
class BoxDrower:
def drawBox(self, image, left_top, right_bottom, name):
print(left_top, right_bottom)
if left_top == None:
print("there is no face")
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment