I'm trying to use https://www.remove.bg to remove the background of my photos. Here is my code:
import requests
response = requests.post(
'https://api.remove.bg/v1.0/removebg',
files={'image_file': open('U:/Training/python/remove-bg-master/child.jpg', 'rb')},
data={'size': 'auto'},
headers={'X-Api-Key': 'API key'}
)
if response.status_code == requests.codes.ok:
with open('child-no-bg.png', 'U:\Training\python\remove-bg-master') as out:
out.write(response.content)
else:
print("Error:", response.status_code, response.text)
But I got an error:
SSLError: HTTPSConnectionPool(host='api.remove.bg', port=443): Max retries exceeded with url: /v1.0/removebg (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')])")))
Could you please tell me what's going on here?