Skip to content

Commit

Permalink
Add face dist thres
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSamhuns committed Sep 29, 2023
1 parent fbc71bc commit 9fa4644
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app_docker_compose/app/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class InputModel(BaseModel):
"""
model_name: str
file_path: str
threshold: float = 0.3
face_det_threshold: float = 0.3
face_dist_threshold: float = 10
person_data: PersonModel = None


Expand Down
4 changes: 2 additions & 2 deletions app_docker_compose/app/routes/recognize_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def run(self):
results = self.func(
model_name=self.input_data.model_name,
file_path=self.input_data.file_path,
threshold=self.input_data.threshold)
face_det_threshold=self.input_data.face_det_threshold,
face_dist_threshold=self.input_data.face_dist_threshold)
self.response_data = {**results}


Expand Down Expand Up @@ -79,7 +80,6 @@ async def recognize_person_url(background_tasks: BackgroundTasks,
response_data = {}
model_type: ModelType = ModelType.SLOW # default to SLOW for now
try:
os.makedirs(DOWNLOAD_CACHE_PATH, exist_ok=True)
file_name = str(uuid.uuid4()) + get_mode_ext("image")
file_cache_path = os.path.join(DOWNLOAD_CACHE_PATH, file_name)
await download_url_file(img_url, file_cache_path)
Expand Down
3 changes: 1 addition & 2 deletions app_docker_compose/app/routes/register_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def run(self):
results = self.func(
model_name=self.input_data.model_name,
file_path=self.input_data.file_path,
threshold=self.input_data.threshold,
face_det_threshold=self.input_data.face_det_threshold,
person_data=self.input_data.person_data.dict())
self.response_data = {**results}

Expand Down Expand Up @@ -83,7 +83,6 @@ async def register_person_url(background_tasks: BackgroundTasks,
"""
response_data = {}
try:
os.makedirs(DOWNLOAD_CACHE_PATH, exist_ok=True)
file_name = str(uuid.uuid4()) + get_mode_ext("image")
file_cache_path = os.path.join(DOWNLOAD_CACHE_PATH, file_name)

Expand Down

0 comments on commit 9fa4644

Please sign in to comment.