dk - edit
This commit is contained in:
+2
-2
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user