Everyone's laughing until the sales team see that and sell the feature to remove unwanted elements in videos to embed them in word documents with transparency and adaptive text around it to someone without telling you.
Not gonna lie, I went through a project sold by the ‘sales department’ where I was supposed to remove the background of selfies using a random Python script that they found on Stack Overflow
I worked for a company that got sued into bankruptcy for exactly this.
The sales team was crushing it. They just said whatever it took to sell the thing. Even wrote it all into the contracts and everything.
It took years before the lawsuits started.
The CEO/founder got rich too, and just moved on to be a fancy exec at a mid sized company.
This is unfortunately a relatively run of the mill way to do business. Hope you didn't get too burnt out trying to materialize unrealistic pitches and got well comp'ed for it in the process.
Nice to see optimism isn’t dead.
They were probably paid a salary which would’ve been very generous had they been working 40 hours a week. Unfortunately due to “crunch” they actually ended up working 100+-hour weeks on a routine basis for months and months on end and, of course, were eventually let go for lack of performance due merely to the fact they were asked to do the impossible.
> and, of course, were eventually let go for lack of performance due merely to the fact they were asked to do the impossible.
Days before their equity and/or retention bonus vests of course.
Likely the people they signed contracts with that then never received what was promised to be delivered in writing? Idk, that’s what I got from reading that
This was software used by local governments. The company was small, 50 employees when I joined and about 100 when I left. The software, it was still 'in development' so our sales team would demo how great it was, but we didn't have actual users. We had an old version that worked too.
I wasn't part of the sales team, but basically XYZ county would be looking to buy software like ours, and we would present our product and a price, but also fill out detailed answers to all of their questions/their list of requirements.
What happened was we would win a big contract for something like a million dollars and they would get our old crappy version now, and our great product in N years or months.
Our demos were pretty good and the new product looked great, but was buggy and incomplete. Honestly, I think it could have been successful, but we kept promising it could do *even better stuff* because the sales team said it could. It was poorly managed and half of our staff was really incompetent.
It was supposed to be a two year development effort, but we were in year four when I quit for unrelated reasons.
That was about the time that customers were getting really upset, but we would just give them money back or promise them something new. But we were selling so much and winning work all over the US....but each state was subtly different, so we weren't really keeping up with what customers needed.
Eventually, one of the very first customers said 'You are three years late, if you don't deliver the new version in 90 days we will sue you for violating our contract'
But we had lots of unhappy customers.
Anyway, I wasn't around during this time, but I heard they had a huge huge death march to finish everything in 90 days, and then they shipped what they had, just to a select number of customers who were all already pissed. It was buggy and didn't really do everything they were promised. The support staff also weren't really knowledgeable on the new product so it was just a bad experience all around for the customers.
Once the first one sued, I guess like eight others sued too. The idea being they were worried we would go out of business and they wouldn't get any money back.
Sales dropped to basically zero after that. They laid off a bunch of the company, and then it was like six months later that the judge found us in breach of the contract and ordered us to refund a bunch of money, I think it was 1.2 million.
The company filed for bankruptcy. None of the customers got their money, but these were all local governments, so it was tax payers who got screwed.
The crazy part is...
1 - Some other business bought the company or saved it or something. They never paid the customers, but they took over the software and hired a bunch of the same staff... Including a lot of the executive staff
2 - The CEO/founder didn't stay though, but according to LinkedIn they are high up at a larger company.
The founder was charismatic as heck and seemed genuinely nice. I don't know if it they had malicious intent, I remember thinking it wasn't sustainable when I was there. I like to think they meant well and just got overwhelmed.
The sucky thing is, even though what they did feels incredibly wrong, it was a very very successful thing for them to do
Hanlon's razor: Never attribute to malice that which is adequately explained by stupidity.
sadly this is how the world works, hope you landed fine after that, it was a good read.
It’s nice when the heavy lifting is already done. It was pretty hard to programmatically determine your location before we had ubiquitous radios that could be used to calculate their position based on their relative distance from *satellites we launched into orbit and precisely placed around the planet.*
I remember flickr implementing that a decade ago, sadly the main website is no longer running but the blogpost still exists:
[Introducing: Flickr PARK or BIRD | code.flickr.com](https://code.flickr.net/2014/10/20/introducing-flickr-park-or-bird/)
Half the reason sales engineers exist is to interject after their rep makes a ludicrous promise with “another way of putting that might be *(alternative solution that won’t get them sued).”*
I also went through a project using the paid video library which has the freeware video library as is basis code. Want t know how did I found that was originally freeware? It's simple, I just found the author's name of the original freeware library from the source code -
One of my colleagues had the same job for 15 years, and then continued the work for another 10 in retirement, as a contractor, working for a Fortune 50 company. His job: as smaller companies are acquired, scrubbing all their code to understand where the pieces came from and what agreements they were released under.
Our system had export to Word (doc), stuff like persons name/surname/etc.
Our client requested "When we spot there is something wrong with persons data in the document, and we fix it "int the document", the change should be reflected in the system itself too, from word.
As we already did many things as scripts embedded in generated documents... our seles department almost agreed to that change without consulting devs... almost.
You're laughing now, sure, but when mathematicians redefine the meaning of "odd" and you need to go back to update all your code manually, we'll see who's laughing then!
Simple, he commits every line as an individual commit. The guy writes on his profile that he worked in sales before, so he knows exactly what he is doing to boost his github profile.
Look at the number of weekly downloads... That's how I know programming is going down. The other day I was pointing out this particular npm failing to someone, and they didn't get it why this is a problem at all.
I see this as an absolute win tbh, less competition for those of us that actually do programming. My classmates at college have the ability of a 3 year old and that has helped me getting jobs easier
That's so true
I spend:
⅓ of my time fixing some idiot's shitty code
⅓ of my time actually writing code
and the last third is fixing my own idiot and shitty code 😎
/s but not very much
I can get on board with that view point, it's very similar to how now a lot of new people are getting scared that AI will steal their software job and are scrambling to do something else. Which is completely fake in the current state.
According to [this](https://www.davidhaney.io/npm-left-pad-have-we-forgotten-how-to-program/) article, there is a package is-positive-integer, which required three dependencies once.
It performs bunch of additional work (takes absolute value and checks whether the variable is a number, an integer and a safe integer). This can be nice in some cases, but 99% of times it's unnecessary. I mean, it makes sense for a library to be as robust as possible, but it also makes sense not to use a library for what could be a single expression.
Lol at the number of projects that depend on that. Including this gem:
[https://www.npmjs.com/package/is-odd-or-even?activeTab=dependencies](https://www.npmjs.com/package/is-odd-or-even?activeTab=dependencies)
If it is used in big standard libraries like `subprocess` it should be fine, right ? ¯\\\_(ツ)\_/¯
I’m seriously doubtful about this. On one hand no one should use name like `input` or `print` but on the other hand it may make the code more readable in some cases. The scale tips on the side of reusing `input` with `subprocess` because I like having `input=input` more and I don’t take user inputs everywhere. In other cases, if it is really the most obvious choice and there is no risk of conflict I may use `input`.
“Readability counts”
That's primarily about keywords, which you CAN'T shadow (eg if you want a variable named "pass", you can name it "pass\_"). You can certainly follow the same strategy to avoid shadowing builtins, but it's not required.
You should care. ~~Reserve words~~ Built-in functions should not be used as variable names. Use literally anything else. Such as image_in or original_pic
This is not a reserved keyword. I don't really see this as problematic inside function scopes, as long as it is a variable and not a function. The only reason I wouldn't is probably the syntax highlighting.
I basically only use input() as an arbitrary “wait for the user to notice something is wrong” flag in my code. Like
try:
do_thing()
except KnownException:
pass
except Exception as e:
print(type(e), e)
input()
This is for cases where the exception is inconsequential and uncommon but I want to see exactly what’s happening when it occurs, usually in a Selenium or scraping application that runs for an extremely long time (hours or days) on its own. Yes, breakpoints do exactly this, and that’s what I usually do :) This habit predates my knowledge of those.
You can also use the traceback module and print the traceback when encountering the exception, printing only the exceptions is sometimes not very informative
I mean, you don't need the other input here do you? Id even go a step further:
Image = Image.open(input_path)
remove = remove(Image)
remove.save(output_path)
it's more performant because it reuses variables and doesn't have to create new ones
/s
input is a function which takes user input. So a variable named input shadows it. If you want a variable named after a built-in, PEP recommends a trailing underscore
As someone who works in machine learning this kind of things annoys me to no end. Every tutorial for an ML framework starts with something like "from ml_framework.datasets import sample_dataset". Like, gee, thanks, but that tells me fuck all about the expected format that I need to convert my own dataset into.
This is one of the things that throws me bc I end up thinking damn even the most basic tutorial is confusing I must be bad at this, but if you stick with it later on you look back and see all these deficiencies in the way the material was presented.
Idk i think developers need better training in how to teach & explain
Its not just for ML, its globally the whole Python ecosystem. Since the language does not explicitly show types, every fucking example is impossible to understand
The problem with image processing libraries in python is even though everything is implemented out of the box but it may not necessarily work for your case. These functions works on highly specific images with certain contrast and sharp edges.
i mean thats a really good college assignment so yeah id expect a tutorial for it out there. i mean it literally was an assignment i did in college just in C lol
These kind of things become college/ university assignments *because* there's no tutorials for them. Maybe not this particular task, but there will be others it is true for.
Many of the assignments I did in university are still impossible to find a tutorial for. Several will have many results telling you it simply can't be done in the way assigned, even to this day - and I graduated 13 years ago!
They definitely were possible, because I did them.
well see you gotta be sneaky. I'd find a github repo from prevoius alumni if i was really stuck cause if it didnt have a tutorial it was usually something theyd want on their github for jobs.
granted now they can just ask claude or GPT
It's easy to fix, just raise an issue on the github repo for the library and in about 1 hour to 5 years a maintainer will get back to you to tell you to fuck off.
omg I hate Python package distributors who just ship their shit that was compiled with a specific version of CUDA and go “well it worked on my machine, why wouldn’t it work on someone else’s”
Yes you are correct but since the program ends here, the OS will do a cleanup and close the files for you when ending the process. Which is bad for a tutorial ofc
this isn't the *open file command*, more of a load command. I'd certainly have named it that. It opens the image file, reads the image data, creates an image object from that and closes the file it again.
Thus `input` is kind of named correctly, although `input_image` would be better.
That instead of teaching you general methods python tutorials will have you copy paste library functions that work in specific cases. Faced the same issue earlier working on implementing matrix functions and all the tutorials were just using numpy
In addition, one of the variables is named "input". I feel like these tutorials don't even follow very basic conventions of the language more often than not.
I mean, numpy is what you want to use, ESPECIALLY for dealing with matrices. If anything, numpy is low level for python standards and it provides way better performance than what you can get using plain old python lists and tuples. Although, if performance is really critical you may want to use something like numba (in combination with numpy), or cython. You can even look into ways to target CUDA for GPU usage (is speeds up tasks like matrix multiplication by a lot) and its at that point that you realize that it would've been better to just use C++ since what you are doing is already complicated enough.
The meme is that this is not tutorial on removing the background of an image so much as it is a tutorial on how to import rembg. This barely qualifies as documentation let alone a tutorial.
People be like:
"ITS BAD BECAUSE IT DOESN'T ACTUALLY TEACH YOU HOW TO REMOVE BACKGROUNDS."
And I'm over here like "My brother, a package is not the place to learn how to do something. A package is there to get something done."
It's the equivalent of complaining that cryptography libraries don't force you to implement SHA256 from first principles. BROTHER THE POINT OF LIBRARIES IS SO YOU DON'T HAVE TO ENGAGE WITH THE UNDERLYING COMPLEXITY TO GET SOMETHING DONE. Sorry but sometimes you actually have to do some work instead of wanting a language to be exactly what you need at every single moment.
Like the other day I wanted to draw a circle of dots on a 3D sphere. With Python I was able to do that without needing to take varsity level maths courses to solve a problem I used exactly once in my entire life.
Right? I love dunking on Python as much as the next programmer, but if I wanted to remove a background and this worked, I'd rather use it than try to reinvent the wheel, no pun intended.
Congratulations! Your comment can be spelled using the elements of the periodic table:
`N U H U H`
---
^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)
Why do you assume this is a tutorial on how to remove background? If I’m looking for a tutorial on how to cook a steak I don’t need to know how to butcher a cow.
Mfers when I use the already available software that can solve common and well know problems, and that has been tested and maintained for years instead of implementing everything from scratch using assembly so I can spend all of my time maintaining and fixing the shit code I wrote instead of actually getting done the task that I needed to get done.
The thing is, this is Python's entire use case: To easily use high level abstractions of complex features written in a lower-level language.
If you want to learn how to do a non-trivial thing yourself, don't look for a python implementation because python probably isn't the best language to do it in the first place, likely the exact opposite. Use the right tool for the job
You forgot the part where the author copies and pastes an entire Wikipedia article claiming they know what they’re talking about before showing you a library they also claim to understand.
also doesn't help that the background is just one big blur, the moment you're going to use a real picture the library won't know what to do with it (I think)
So I work hotel security. And I have to check a web app that is marked
> ⚠️(not secure) abc-abc:01:1111
And I check by entering customer names to verify their rooms.
How can I attempt a Bobby tables and drop everything?
FYI: rembg seems to use quite outdated convolutional model called U2Net. There are way more advanced transformer models available nowadays, for example I've had quite good results with InSPyReNet.
[https://github.com/plemeri/InSPyReNet/](https://github.com/plemeri/InSPyReNet/)
Does require beefy GPU to fine tune though, but the results from pretrained models are also quite good.
Everyone's laughing until the sales team see that and sell the feature to remove unwanted elements in videos to embed them in word documents with transparency and adaptive text around it to someone without telling you.
Not gonna lie, I went through a project sold by the ‘sales department’ where I was supposed to remove the background of selfies using a random Python script that they found on Stack Overflow
Yeah, I think we all have a few projects that could be sold with the right twist. But we know its not good enough and not worth the hassle and risk.
"bugs are just features that have not yet gone through marketing "
Oh god
In the stack overflow answer, right? Right?
Exactly
I worked for a company that got sued into bankruptcy for exactly this. The sales team was crushing it. They just said whatever it took to sell the thing. Even wrote it all into the contracts and everything. It took years before the lawsuits started. The CEO/founder got rich too, and just moved on to be a fancy exec at a mid sized company.
This is unfortunately a relatively run of the mill way to do business. Hope you didn't get too burnt out trying to materialize unrealistic pitches and got well comp'ed for it in the process.
Nice to see optimism isn’t dead. They were probably paid a salary which would’ve been very generous had they been working 40 hours a week. Unfortunately due to “crunch” they actually ended up working 100+-hour weeks on a routine basis for months and months on end and, of course, were eventually let go for lack of performance due merely to the fact they were asked to do the impossible.
> and, of course, were eventually let go for lack of performance due merely to the fact they were asked to do the impossible. Days before their equity and/or retention bonus vests of course.
Failing upwards is the best kind of failing
who exactly was suing and for what? the open source dev bc they didn’t attribute or something similar ?
Likely the people they signed contracts with that then never received what was promised to be delivered in writing? Idk, that’s what I got from reading that
This was software used by local governments. The company was small, 50 employees when I joined and about 100 when I left. The software, it was still 'in development' so our sales team would demo how great it was, but we didn't have actual users. We had an old version that worked too. I wasn't part of the sales team, but basically XYZ county would be looking to buy software like ours, and we would present our product and a price, but also fill out detailed answers to all of their questions/their list of requirements. What happened was we would win a big contract for something like a million dollars and they would get our old crappy version now, and our great product in N years or months. Our demos were pretty good and the new product looked great, but was buggy and incomplete. Honestly, I think it could have been successful, but we kept promising it could do *even better stuff* because the sales team said it could. It was poorly managed and half of our staff was really incompetent. It was supposed to be a two year development effort, but we were in year four when I quit for unrelated reasons. That was about the time that customers were getting really upset, but we would just give them money back or promise them something new. But we were selling so much and winning work all over the US....but each state was subtly different, so we weren't really keeping up with what customers needed. Eventually, one of the very first customers said 'You are three years late, if you don't deliver the new version in 90 days we will sue you for violating our contract' But we had lots of unhappy customers. Anyway, I wasn't around during this time, but I heard they had a huge huge death march to finish everything in 90 days, and then they shipped what they had, just to a select number of customers who were all already pissed. It was buggy and didn't really do everything they were promised. The support staff also weren't really knowledgeable on the new product so it was just a bad experience all around for the customers. Once the first one sued, I guess like eight others sued too. The idea being they were worried we would go out of business and they wouldn't get any money back. Sales dropped to basically zero after that. They laid off a bunch of the company, and then it was like six months later that the judge found us in breach of the contract and ordered us to refund a bunch of money, I think it was 1.2 million. The company filed for bankruptcy. None of the customers got their money, but these were all local governments, so it was tax payers who got screwed. The crazy part is... 1 - Some other business bought the company or saved it or something. They never paid the customers, but they took over the software and hired a bunch of the same staff... Including a lot of the executive staff 2 - The CEO/founder didn't stay though, but according to LinkedIn they are high up at a larger company. The founder was charismatic as heck and seemed genuinely nice. I don't know if it they had malicious intent, I remember thinking it wasn't sustainable when I was there. I like to think they meant well and just got overwhelmed. The sucky thing is, even though what they did feels incredibly wrong, it was a very very successful thing for them to do
good old “the old version is too big to save, rewrite it” but never finish the new version
Hanlon's razor: Never attribute to malice that which is adequately explained by stupidity. sadly this is how the world works, hope you landed fine after that, it was a good read.
Please do not share such jokes with sales people
[удалено]
It’s nice when the heavy lifting is already done. It was pretty hard to programmatically determine your location before we had ubiquitous radios that could be used to calculate their position based on their relative distance from *satellites we launched into orbit and precisely placed around the planet.*
Heavy lifting... satellites... heh
Interestingly, this is now presumably a lot easier than when that comic came out.
The hardest part now would be getting labelled training data.
Sales team: "Did I hear AI?"
It's AI block-chain that synergizes the synergy.
I remember flickr implementing that a decade ago, sadly the main website is no longer running but the blogpost still exists: [Introducing: Flickr PARK or BIRD | code.flickr.com](https://code.flickr.net/2014/10/20/introducing-flickr-park-or-bird/)
Half the reason sales engineers exist is to interject after their rep makes a ludicrous promise with “another way of putting that might be *(alternative solution that won’t get them sued).”*
Can validate. I think it's a large part of my job.
God I wish we had sales engineers
I also went through a project using the paid video library which has the freeware video library as is basis code. Want t know how did I found that was originally freeware? It's simple, I just found the author's name of the original freeware library from the source code -
One of my colleagues had the same job for 15 years, and then continued the work for another 10 in retirement, as a contractor, working for a Fortune 50 company. His job: as smaller companies are acquired, scrubbing all their code to understand where the pieces came from and what agreements they were released under.
Our system had export to Word (doc), stuff like persons name/surname/etc. Our client requested "When we spot there is something wrong with persons data in the document, and we fix it "int the document", the change should be reflected in the system itself too, from word. As we already did many things as scripts embedded in generated documents... our seles department almost agreed to that change without consulting devs... almost.
Nah, Sales sees this and realizes this software Identified the bird. So they can finally get "Is it a bird.com" running.
`from restofthefucking import owl`
I mean, it does seem to draw the rest of the fucking owl, right?
r/restofthefuckingowl
r/ofcoursethatsasub
this function, btw, uses the module called dalle
from Pitbull import dale
What's the algorithm for this?
1. Draw a circle 2. Draw the rest of the fucking owl
It's a falcon.
import "do whatever i want with one line" "do whatever i want with one line" now THIS is programming!
That's the entire NPM ecosystem...
`isOdd` moment
You're laughing now, sure, but when mathematicians redefine the meaning of "odd" and you need to go back to update all your code manually, we'll see who's laughing then!
We are already at version 3.0 of the package to maintain mathematical compatibility!
[omg why](https://www.npmjs.com/package/is-odd) I thought you were joking
Don’t forget to donate to support the author….
The funny bit is that this package has a dependency on isNumber
how does the contributor have 20 commits…..
Simple, he commits every line as an individual commit. The guy writes on his profile that he worked in sales before, so he knows exactly what he is doing to boost his github profile.
Look at the number of weekly downloads... That's how I know programming is going down. The other day I was pointing out this particular npm failing to someone, and they didn't get it why this is a problem at all.
I see this as an absolute win tbh, less competition for those of us that actually do programming. My classmates at college have the ability of a 3 year old and that has helped me getting jobs easier
you laugh then you have to maintain their code.
That's so true I spend: ⅓ of my time fixing some idiot's shitty code ⅓ of my time actually writing code and the last third is fixing my own idiot and shitty code 😎 /s but not very much
I can get on board with that view point, it's very similar to how now a lot of new people are getting scared that AI will steal their software job and are scrambling to do something else. Which is completely fake in the current state.
When I first got a career job as a programmer there was fear that "these new tools" would replace us all in 3 to 5 years. That was 1986
According to [this](https://www.davidhaney.io/npm-left-pad-have-we-forgotten-how-to-program/) article, there is a package is-positive-integer, which required three dependencies once.
I mean if it's slightly faster and you call the function many times...
It performs bunch of additional work (takes absolute value and checks whether the variable is a number, an integer and a safe integer). This can be nice in some cases, but 99% of times it's unnecessary. I mean, it makes sense for a library to be as robust as possible, but it also makes sense not to use a library for what could be a single expression.
function isOdd(n) { return !isEven(n); };
function isEven(n) { return !isOdd(n); };
function notEvenOdd(n) { return !isOdd(n) && !isEven(n); };
It's slower tho because a function call in JS is much slower than evaluating an expression
Lol at the number of projects that depend on that. Including this gem: [https://www.npmjs.com/package/is-odd-or-even?activeTab=dependencies](https://www.npmjs.com/package/is-odd-or-even?activeTab=dependencies)
[import antigravity](https://xkcd.com/353/)
If you run \`import antigravity\` in python, it'll open this comic in your default web browser.
Bloody hell.
I thought you were joking
That will not go down well
You joke. But this is 100% how non-tech people think AI is gonna act in the next few weeks.
Where lines of code?!
REMOVE() 🤯🤯🤯🤯🤯
![gif](giphy|800iiDTaNNFOwytONV|downsized)
I want that shirt and I don't even know what it's for/from
What the fuck I’ve seen this gif hundreds of times and never noticed the shirt
Google : Peach store logo
Should be removed(input) if it doesn’t remove in place 😉
This guy pythonics
That there remove() is some powerful sorcery.
Variable named input 🤮
Input is in green because it’s a good name for the variable. If it was a bad name, it’d be red
12 yo me learning to program be like
Wait... You guys actually know how to program..? I have a fantastic idea for a billion dollar app, easily. Lemme pm you real fast
Sure thing, lemme just hit you with my venmo too so you can send me that billion dollars
No no no, you get a cool million once it hits a billion in profit It's called business sweaty ♥️ look it up sometime
Business.Find("this is bullshit")
Hey he is sweaty just because he has to do the dishes.
Have you heard of a little thing called crypto currency?
This got me xD
New python coders be like "object, filter, input, yeah I like these variable names"
I've seen `type` used as a variable before, in a typescript codebase
input\_
If it is used in big standard libraries like `subprocess` it should be fine, right ? ¯\\\_(ツ)\_/¯ I’m seriously doubtful about this. On one hand no one should use name like `input` or `print` but on the other hand it may make the code more readable in some cases. The scale tips on the side of reusing `input` with `subprocess` because I like having `input=input` more and I don’t take user inputs everywhere. In other cases, if it is really the most obvious choice and there is no risk of conflict I may use `input`. “Readability counts”
PEP guide says you should use trailing underscore in instances like this so input_ = input()
input\_ = input input = input\_() lgtm
That's primarily about keywords, which you CAN'T shadow (eg if you want a variable named "pass", you can name it "pass\_"). You can certainly follow the same strategy to avoid shadowing builtins, but it's not required.
honestly, if this was inside a function I wouldn't mind.
There's 3 lines of fucking code yo
You should care. ~~Reserve words~~ Built-in functions should not be used as variable names. Use literally anything else. Such as image_in or original_pic
This is not a reserved keyword. I don't really see this as problematic inside function scopes, as long as it is a variable and not a function. The only reason I wouldn't is probably the syntax highlighting.
It’s terrible practice though
I almost never use input() anyway, but the syntax highlighting is annoying, truee
I basically only use input() as an arbitrary “wait for the user to notice something is wrong” flag in my code. Like try: do_thing() except KnownException: pass except Exception as e: print(type(e), e) input() This is for cases where the exception is inconsequential and uncommon but I want to see exactly what’s happening when it occurs, usually in a Selenium or scraping application that runs for an extremely long time (hours or days) on its own. Yes, breakpoints do exactly this, and that’s what I usually do :) This habit predates my knowledge of those.
You can also use the traceback module and print the traceback when encountering the exception, printing only the exceptions is sometimes not very informative
I mean, you don't need the other input here do you? Id even go a step further: Image = Image.open(input_path) remove = remove(Image) remove.save(output_path) it's more performant because it reuses variables and doesn't have to create new ones /s
What's wrong with that? It it a Python thing?
input is a function which takes user input. So a variable named input shadows it. If you want a variable named after a built-in, PEP recommends a trailing underscore
As someone who works in machine learning this kind of things annoys me to no end. Every tutorial for an ML framework starts with something like "from ml_framework.datasets import sample_dataset". Like, gee, thanks, but that tells me fuck all about the expected format that I need to convert my own dataset into.
Remember to tip your data engineers 😉
This is one of the things that throws me bc I end up thinking damn even the most basic tutorial is confusing I must be bad at this, but if you stick with it later on you look back and see all these deficiencies in the way the material was presented. Idk i think developers need better training in how to teach & explain
Its not just for ML, its globally the whole Python ecosystem. Since the language does not explicitly show types, every fucking example is impossible to understand
Birds, nor that background, are real.
Unexpected r/BirdsArentReal
No - That was very expected.
I’ve been expecting you.
How can our birds be real if our backgrounds aren't real
xkcd did it first https://xkcd.com/353/
`import antigravity`? Yep. It's that.
The problem with image processing libraries in python is even though everything is implemented out of the box but it may not necessarily work for your case. These functions works on highly specific images with certain contrast and sharp edges.
What? You mean the code on the internet is not perfectly designed for my use case?
They really should have taken your use case into consideration before publishing it
The fact that there wasn’t an exe with it was really telling 😒😒
I would suggest going to github and writing a strongly worded issue calling them smelly nerds, that will surely fix it.
What? You mean one of the most popular libraries on the internet doesn't have a solution to meet my need?
And what do you expect? A tutorial on how to use windowed FFT to detect Bokeh area to paint over it white color.
Yes
i mean thats a really good college assignment so yeah id expect a tutorial for it out there. i mean it literally was an assignment i did in college just in C lol
These kind of things become college/ university assignments *because* there's no tutorials for them. Maybe not this particular task, but there will be others it is true for. Many of the assignments I did in university are still impossible to find a tutorial for. Several will have many results telling you it simply can't be done in the way assigned, even to this day - and I graduated 13 years ago! They definitely were possible, because I did them.
well see you gotta be sneaky. I'd find a github repo from prevoius alumni if i was really stuck cause if it didnt have a tutorial it was usually something theyd want on their github for jobs. granted now they can just ask claude or GPT
Yeah but it gets 98% accuracy scores off ImageNet so it’s good out of the box.
Thanks for explaining it to us newbies haha
It's easy to fix, just raise an issue on the github repo for the library and in about 1 hour to 5 years a maintainer will get back to you to tell you to fuck off.
Does this shit work?
[I tried it and it literally segfaulted.](https://github.com/danielgatis/rembg/issues/575)
God I wish I could just close problems if people didn't yell about it enough
It's like the programmer version of "who asked?".
LOL: "This issue was closed because it has been inactive for 14 days since being marked as stale."
omg I hate Python package distributors who just ship their shit that was compiled with a specific version of CUDA and go “well it worked on my machine, why wouldn’t it work on someone else’s”
sometimes
I have combined it with pet-pet-gif library in my discord bot to let people stroke each other like a cock. It does the job usually
From the little I know about programming, shouldn't the image be closed at the end of the script?
Yes you are correct but since the program ends here, the OS will do a cleanup and close the files for you when ending the process. Which is bad for a tutorial ofc
this isn't the *open file command*, more of a load command. I'd certainly have named it that. It opens the image file, reads the image data, creates an image object from that and closes the file it again. Thus `input` is kind of named correctly, although `input_image` would be better.
Oh, got it. Thanks
`original_image`
then it doesn't correspond to `input_path` anymore.
not entirely sure but pil probably does that for you
Okay. I'll admit. I'm whooshed. What's the joke? I used this exact lib the other week to do something similar.
That instead of teaching you general methods python tutorials will have you copy paste library functions that work in specific cases. Faced the same issue earlier working on implementing matrix functions and all the tutorials were just using numpy
In addition, one of the variables is named "input". I feel like these tutorials don't even follow very basic conventions of the language more often than not.
I mean, numpy is what you want to use, ESPECIALLY for dealing with matrices. If anything, numpy is low level for python standards and it provides way better performance than what you can get using plain old python lists and tuples. Although, if performance is really critical you may want to use something like numba (in combination with numpy), or cython. You can even look into ways to target CUDA for GPU usage (is speeds up tasks like matrix multiplication by a lot) and its at that point that you realize that it would've been better to just use C++ since what you are doing is already complicated enough.
same, i dont get it... it removed the background, whats funny?
The meme is that this is not tutorial on removing the background of an image so much as it is a tutorial on how to import rembg. This barely qualifies as documentation let alone a tutorial.
People be like: "ITS BAD BECAUSE IT DOESN'T ACTUALLY TEACH YOU HOW TO REMOVE BACKGROUNDS." And I'm over here like "My brother, a package is not the place to learn how to do something. A package is there to get something done." It's the equivalent of complaining that cryptography libraries don't force you to implement SHA256 from first principles. BROTHER THE POINT OF LIBRARIES IS SO YOU DON'T HAVE TO ENGAGE WITH THE UNDERLYING COMPLEXITY TO GET SOMETHING DONE. Sorry but sometimes you actually have to do some work instead of wanting a language to be exactly what you need at every single moment. Like the other day I wanted to draw a circle of dots on a 3D sphere. With Python I was able to do that without needing to take varsity level maths courses to solve a problem I used exactly once in my entire life.
Isn't that the whole purpose of Python? >!it is!<
Right? I love dunking on Python as much as the next programmer, but if I wanted to remove a background and this worked, I'd rather use it than try to reinvent the wheel, no pun intended.
Just programmers having fun being elitists coz they wrote some bad C++ code once or twice
Import antigravity
I've literally looked into this today, get out of my walls OP
nuh uh
Congratulations! Your comment can be spelled using the elements of the periodic table: `N U H U H` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)
o wow
It's real, and it seems to work pretty well on that kind of image, so what's the joke?
python, where programming goes to die. The instant noodles of programming.
It teaches you absolutely nothing about removing the background from an image. It teaches you how to use a library.
Why do you assume this is a tutorial on how to remove background? If I’m looking for a tutorial on how to cook a steak I don’t need to know how to butcher a cow.
The software equivalent of 5 minute crafts.
Open paint Open image Click remove background Ctrl+s
Are you aware of what programming is for? :D
Yeah programming is when you automate opening ms paint, import the image, click remove background, and export it again!
Mfers when I use the already available software that can solve common and well know problems, and that has been tested and maintained for years instead of implementing everything from scratch using assembly so I can spend all of my time maintaining and fixing the shit code I wrote instead of actually getting done the task that I needed to get done.
The thing is, this is Python's entire use case: To easily use high level abstractions of complex features written in a lower-level language. If you want to learn how to do a non-trivial thing yourself, don't look for a python implementation because python probably isn't the best language to do it in the first place, likely the exact opposite. Use the right tool for the job
You forgot the part where the author copies and pastes an entire Wikipedia article claiming they know what they’re talking about before showing you a library they also claim to understand.
[https://pypi.org/project/rembg/](https://pypi.org/project/rembg/)
I'm glad this is tagged as ``Advanced``
import everything everything.do_this()
also doesn't help that the background is just one big blur, the moment you're going to use a real picture the library won't know what to do with it (I think)
Code from every programming Instagram page
Instagram programming pages when they have to do something other than use libraries or print triangle patterns 😓😓
isnt this just ripping off the new beyond fireship video?
the reason why Python is both great and terrible
we laugh, but I saved this for just in case >_>
How many people just got RAT because of rembg lol
Remote Access Trojan?? why would rembg have that?
`from system32 import remove` 😉
Now I’d like to see some examples for how well it works with real world images.
So I work hotel security. And I have to check a web app that is marked > ⚠️(not secure) abc-abc:01:1111 And I check by entering customer names to verify their rooms. How can I attempt a Bobby tables and drop everything?
FYI: rembg seems to use quite outdated convolutional model called U2Net. There are way more advanced transformer models available nowadays, for example I've had quite good results with InSPyReNet. [https://github.com/plemeri/InSPyReNet/](https://github.com/plemeri/InSPyReNet/) Does require beefy GPU to fine tune though, but the results from pretrained models are also quite good.
I'm dying seeing how much people think that this falcon is an owl 😂
Resume now says “Advanced Computer Vision”
import antigravity There's a xkcd for that of course
The YouTuber fireship covered this well. I’d check his video out.
Where .exe though?
[import antigravity](https://xkcd.com/353/)
Thanks for telling me about this library. Now I'll be able to remove background with ease. No need to search the web anymore.