dk - edit

This commit is contained in:
2026-08-20 16:57:54 +09:00
parent 6dc219d205
commit f0429fea36
4 changed files with 415 additions and 8 deletions
+2 -2
View File
@@ -259,7 +259,7 @@ class PersonAttribute:
results[name] = value
return results
def predict(self, image: Image.Image) -> dict[str, str]:
def predict_image(self, image: Image.Image) -> dict[str, str]:
if self.model is None:
raise RuntimeError('Model is not loaded. Call load(model_filepath) first.')
src = self.preprocess(image).to(self.device)
@@ -274,7 +274,7 @@ class PersonAttribute:
box = self.parse_xywh(xywh)
image = self.load_image(str(image_url).strip())
crop = self.crop_person(image, box)
return self.predict(crop)
return self.predict_image(crop)
@staticmethod
def format_result(attributes: dict[str, Any], status: str = 'PASS') -> dict[str, Any]: