Remove Background Using Python | Python Program to Remove Background From Image | AIOC

Publié le: 11 septembre 2021
sur la chaîne: AIOC all in one code
3,647
107

#aioc #allinonecode

Website: https://allinonecode.com/
API: https://www.remove.bg/api#easy-to-int...

Remove Background automatically with 1 API call
Explore our API documentation and examples to integrate remove.bg into your application or workflow.

Requires "requests" to be installed (see python-requests.org)
import requests

response = requests.post(
'https://api.remove.bg/v1.0/removebg',
files={'image_file': open('/path/to/file.jpg', 'rb')},
data={'size': 'auto'},
headers={'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'},
)
if response.status_code == requests.codes.ok:
with open('no-bg.png', 'wb') as out:
out.write(response.content)
else:
print("Error:", response.status_code, response.text)


Sur cette page du site, vous pouvez voir la vidéo en ligne Remove Background Using Python | Python Program to Remove Background From Image | AIOC durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur AIOC all in one code 11 septembre 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,647 fois et il a aimé 107 téléspectateurs. Bon visionnage!