How is this funny? 8 Upvotes at current writing???
It’s kind of funny because it looks like it is nonsense dreamt up by a non-programmer. But it actually works.
It’s basically import antigravity
I thought it was poking fun at the tutorial saying instead of learning to code, import a library from someone who knows how to code.
Because this example isn’t really programming, it’s just calling an existing library. Which is the big joke about Python.
My best guess is it’s a play at the usual “all you do in python is import libraries without knowing how they work lololol” dig but yeah, I don’t find it particularly funny either
Hahaha now code-golf it. One line FTW!
remove(Image.open(‘cl.jpeg’)).save(‘output.png’)
If I find this in production I’m whipping your ballsack till you change it back.
Can i hire you?
That reminds me back when some time ago, I was tired of dealing with sketchy, and often broken, websites and programs for downloading videos from Youtube. I figured these sorts of programs must be doing something along the lines of downloading the Youtube page, parsing through the massive pile of HTML and Javascript to find the stream, and then saving that to a video file. That seemed like something I could do myself with Python, so I set out to see if I could figure out how to do it.
A few minutes and a couple of web searches later, I discovered that someone else had figured that all out already and I just needed to do “pip install pytube”.
Have you ever heard about yt-dl?
yt-dlp
Remove seems like a terrible name for that method.
While yes, the true issue here is that, for some reason, the code only imports the remove method from the package, instead of importing the package and doing rembg.remove().
if you only wanted to import remove you could maybe import as rembg_remove
unless there’s some weird taboo against doing that I don’t know about, I’m an awful programmer tbh