Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -67,8 +67,9 @@ def extract_persons(image: np.ndarray, bboxes: np.ndarray) -> list[Image.Image]:
|
|
67 |
person_pil_image = Image.fromarray(person_image).convert('RGB') # Convert to RGB
|
68 |
with io.BytesIO() as output:
|
69 |
person_pil_image.save(output, format='JPEG') # Convert to JPEG
|
|
|
70 |
person_pil_image = Image.open(output) # Reopen to ensure format
|
71 |
-
|
72 |
return person_images
|
73 |
|
74 |
|
|
|
67 |
person_pil_image = Image.fromarray(person_image).convert('RGB') # Convert to RGB
|
68 |
with io.BytesIO() as output:
|
69 |
person_pil_image.save(output, format='JPEG') # Convert to JPEG
|
70 |
+
output.seek(0) # Move to the start of the BytesIO buffer
|
71 |
person_pil_image = Image.open(output) # Reopen to ensure format
|
72 |
+
person_images.append(person_pil_image)
|
73 |
return person_images
|
74 |
|
75 |
|