Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

540
Views
Pixellib - removing background takes huge processing

I am using Pixellib library in Python to detect a person and change its background, as shown in their example here.

It works flawlessly, but takes huge processing power on my laptop, coupled with their large (~150mb) pascalvoc model, thus rendering an image in approx 4-5sec.

I need to be able to do the same via a mobile phone app, so certainly this cannot be run on a user's mobile. Alternative is to run this on cloud and return the processed image back. This is both costly if user requests increase and will still have noticable lag on user's app.

So, how do achieve this? Apps like Canva Pro seem to do this seamlessly in an app fairly quickly. In fact, there are many other 'free' apps on Play store claiming to do the same.

Thus, is there a better way to run Pixellib, to make it more performant? Or any other library that can provide similar (or better) ouptut and can be run on user's mobile?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There is remove.bg
It is the most easy tool,to remove background automatically
Sample code:-https://www.remove.bg/api#sample-code
Screenshots: Picture picture2 Here is an example of doing in Python:

# 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)

Since your are using python , This https://github.com/brilam/remove-bg by @brilam will help you.
It is a Python API wrapper for removing backgrounds from picture using remove.bg's API. But it also offers go based command line tool:-https://github.com/remove-bg/go


In addition to that, there are many other opensource library for python in GitHub for your reference:
https://github.com/topics/background-removal?l=python

Also, you can try,
https://github.com/danielgatis/rembg

OR, refer research paper for your understanding: https://arxiv.org/pdf/2005.09007.pdf

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!