Pixellib - removing background takes huge processing [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 months ago.
Improve this question
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?

There is remove.bg
It is the most easy tool,to remove background automatically
Sample code:-https://www.remove.bg/api#sample-code
Screenshots:
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

Related

Extract Author Name and Abstract from python Code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
In my python project, I've list of cited papers and for each paper, I need its Author Name and Abstract and Citation Count from google scholars . I was using scholarly . PyPI like this :
search_pub = scholarly.search_pubs(paperName)
docInfo = next(search_pub)
but now I'm getting this error:
Exception: Cannot fetch the page from Google Scholar.
It seems like they've blocked my IP due to multiple requests. Now I'm unable to find any other programmatic way to extract these info. I can have a list of paper references to extract data for.
Can anyone help me out with any python library or guide me to write some piece of code for this?
You can just wait for this temporary ban to expire and keep going. Make sure to insert a time.sleep(...) or similar in your code to stay under their rate limit. Google Scholar has no official API, so scraping is your only option if this is the data you want.
(I am not recommending that you scrape, and please note that Google Scholar disallows robots through their robots.txt)
Google Scholar blocks your IP if you query too much or too often. Even if you make your program sleep, do not make it sleep periodically since they can detect that too. Google considers this as DoS (Denial of Service) attack. Even if you randomise your sleep time, at one point, if you make too many queries, it will flag you. One workaround for this is using rotating proxy services. Look up online, there are plenty of free ones. They offer you User-Agent strings, which if you put randomly for every query you make, you're good to go afaik.

Python Script Written - GUI options? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I really am lost.
I've written a python script which takes two files, converts one to the same format as the second and outputs the differences.
I now need to create some kind of GUI?
I'm thinking a relatively simple HTML page which allows users to click on two separate boxes to upload each of the files and then submit them - resulting in the output being offered as file which the user can download to the PC.
Any help of direction would be really appreciated. It's only really a guess that HTML will be my best/simplest choice. Working from the command line isn't really an option I can go with. The PC that this will sit on will not have internet access. I intend to have this installed on the PC as an application.
I accept I'll need to make some changes to my Python code. Posted this here as I'm not sure Python questions would have been the best place but I'll move it if suggested.
Please, any help at all will be useful. First timer
This is not a kind of answer that normally gets a reply on StackOverflow because it is much too broad / subjective.
Given the fact that you are quite new I would like to provide a solution anyway that will allow you to build a GUI quite easily like EasyGUI.
A very easy example:
import easygui
easygui.msgbox('This is a basic message box.', 'Title Goes Here')
Other possibilities (less customizable but arguably easier) are Wooey (automatic web interface generation for your script) and Gooey (automatic GUI generation for your script.
Please, for next time, remember to always provide a Minimal Reproducible Example and read https://stackoverflow.com/help/how-to-ask
I don't suggest you use the Django Framework for such a small application.
You should definitely use Flask for this. Flask is more lightweight

Is there any URL info / meta data webservice API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there any known URL info API which will provide data like title, description, content-type, image etc? I researched a bit but have not come across any such API. Eventually, I have ventured out creating something like from scratch.
The consumption of such API can be for various web apps which need to display URL information. A typical real world example is Facebook using something similar when you share / attach a link in a status update.
Suggestions welcomed as it will save me the effort of maintaining such a webservice myself.
Edit:
Found two good sources which can be helpful
Protonet - The Art Of Turning URLs Into A User Readable Preview
Using YQL to do a quick fetch
Iframely web service
Edit:
After much research and to address my specific use-case, I created my own API that is hosted on Google App Engine for this. Someone looking for this, may get in touch.
There's no such API to the best of my knowledge, simply because accessing such an API wouldn't be much simpler than just fetching the page itself.
I like the idea and I think you should try to implement it and "sell" it to other web developers. Of course there will be a trust issue -- will they trust you not to lie?

Open source Twitter clone (in Ruby/Python) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there any production ready open source twitter clones written in Ruby or Python ?
I am more interested in feature rich implementations, not just bare bones twitter like messages (e.g.: APIs, FBconnect, Notifications, etc)
Thanks !
I know of twissandra which is an open source clone. Of course I doubt it meets your need of feature rich implementations.
http://github.com/rnielsen/twetter
From their readme:
Twetter is an implementation of the twitter.com API, designed for use in situations where internet access is not available but a large number of people have twitter clients and want to tell each other what they are doing, for example a RailsCamp, where it was first developed.
The current goal is to have it work with as many third party twitter clients as possible. It has currently been tested with Twitterific, TwitterFox, and Spaz on OSX.
The following open source alternative to twitter : http://identi.ca/ is written using the the software http://status.net/ . It looks like it is written in PHP too.
Also there is http://code.google.com/p/jaikuengine/ which is a microblogging platform for google app engine. This should serve as an example for python implementation.
Also look at http://www.typepad.com/go/motion/
Found two relevant projects:
http://github.com/insoshi/insoshi
http://github.com/dmitryame/echowaves/wiki
Sadly both appear discontinued

Looking for knowledge base integrated with bug tracker in python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Ok, I am not sure I want to use Request Tracker and RTFM, which is a possible solution.
I'd like to have a knowledge base with my bug tracker/todo list , so that when
I solve a problem, I would have a record of its resolution for myself or others later.
What python based solutions are available?
A highly flexible issue tracker in Python I would recommend is "Roundup":
http://roundup.sourceforge.net/.
An example of its use can be seen online at http://bugs.python.org/.
Try Trac
I do have experience using probably 20-30 different bug trackers, installed or hosted and so far if you are up to deal with a big number of bugs and you want to spend less time coding-the-issues-tracker, to get Atlassian Jira, which is free for open-source projects.
Yes, it's not Python, it is Java, starts slowly and requires lots of resources. At the same time, RAM is far less expensive than your own time and if you want to extend the system you can do it in Python by using https://pypi.python.org/pypi/jira-python/
Do you think that Jira is the most used bug tracker for no reason? It wasn't the first on the market, in fact is quite new compared with others.
Once deployed you can focus on improving the workflows instead of patching the bug tracker.
One of the best features that it has is the ability to link to external issues and be able to see their status, without having to click on them. As an warning, for someone coming from another tracekr you may discover that there are some design limitations, like the fact that a bug can have a single assignee. Don't be scared about it, if you look further you will find that there are way to assign tickets to groups of peoples.

Categories

Resources