How Do I Obtain the Base64 Code of an Image?
An image needs to be converted to its Base64 code for recognition. This section uses Python as an example to describe how to convert a local image to the Base64 code. You can also use an online conversion tool.
Replace d:\demo.jpg in the code with the actual image path.
import base64 with open("d:/demo.jpg", "rb") as image_file: encoded_string = base64.b64encode(image_file.read()).decode() print(encoded_string)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot