Update handler.py
Browse files71 unmodified lines7273747575767778797980818271 unmodified lines clothes = img[y1: y2, x1: x2] clothes = cv2.cvtColor(clothes, cv2.COLOR_BGR2RGB) retval , buffer = cv2.imencode('.jpg', clothes) im_bytes = buffer.tobytes() # im_bytes = buffer.tobytes() # cv2.imwrite("result.jpg", clothes) # create base 64 object jpg_as_text = base64.b64encode(im_bytes).decode("utf-8") # Decode bytes to string") jpg_as_text = base64.b64encode(buffer).decode("utf-8") # Decode bytes to string") # base64_encoded = base64.b64encode(image_bytes).decode("utf-8") # Get the image formathandler.py+2-2