m8chaa commited on
Commit
be8e1ef
·
verified ·
1 Parent(s): 499b376

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -294,7 +294,7 @@ async def cutting_image(masked_image, image_contents, cut_images, s3_orginal_url
294
  # Check if the area of the bounding rectangle is greater than 50px x 50px
295
  if w_pad > 150 or h_pad > 150:
296
  cropped_image = original_image[y_pad:y_pad + h_pad, x_pad:x_pad + w_pad]
297
- _, img_encoded = cv2.imencode('.png', cropped_image)
298
  base64_str = base64.b64encode(img_encoded).decode('utf-8')
299
  cut_images.append(base64_str)
300
 
 
294
  # Check if the area of the bounding rectangle is greater than 50px x 50px
295
  if w_pad > 150 or h_pad > 150:
296
  cropped_image = original_image[y_pad:y_pad + h_pad, x_pad:x_pad + w_pad]
297
+ _, img_encoded = cv2.imencode('.jpg', cropped_image, [int(cv2.IMWRITE_JPEG_QUALITY), 90])
298
  base64_str = base64.b64encode(img_encoded).decode('utf-8')
299
  cut_images.append(base64_str)
300