Saad0KH commited on
Commit
d64d60f
·
verified ·
1 Parent(s): 44be11c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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='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)
 
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)