Created
November 7, 2021 10:57
-
-
Save baudneo/c72179301c7ad4dab95c3706d84527bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Other attempt | |
response = requests.post(to the api that serves images) | |
r = response | |
img = np.asarray(bytearray(response.content), dtype="uint8") | |
image = cv2.imdecode(img, cv2.IMREAD_COLOR) # RGB ? | |
object['thing'] = image | |
# Now to send it in the response | |
img = object['thing'].tobytes() | |
response = make_response(img) | |
response.headers['ML-Data'] = detection_data | |
response.headers['Content-Disposition'] = "attachment; filename='image.jpg'" | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment