Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def extract_persons(image: np.ndarray, bboxes: np.ndarray) -> list[Image.Image]:
|
|
66 |
person_image = image[y1:y2, x1:x2] # Crop the detected person
|
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='
|
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)
|
|
|
66 |
person_image = image[y1:y2, x1:x2] # Crop the detected person
|
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='PNG') # Save as PNG
|
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)
|