不会PS没关系,用python实现人工智能Ai抠图!

时间:2025-03-31 15:00:42

from removebg import RemoveBg

import requests

import os

if __name__ == '__main__':

 path = '%s\picture'%()

 ispath = (path)

 if not ispath:

  (path)

 response = (

  '/v1.0/removebg',

  files={'image_file': open(path+'/', 'rb')},

  # data={'size': 'auto','bg_color':'FFB6C1'},

  data={'size': 'auto'},

  headers={'X-Api-Key': '****YOU API KEY****'},

 )

 if response.status_code == :

  with open(path+'/', 'wb') as out:

   ()

 else:

  print("Error:", response.status_code, )

 我是一名python开发工程师,整理了一套python的学习资料,从基础的python脚本到web开发、爬虫、数据分析、数据可视化、机器学习、面试真题等。想要的可以进群:688244617免费领取