ezaldeen99 / backgroundremoval Goto Github PK
View Code? Open in Web Editor NEWBackground Removal written with swift using u2net model
License: Apache License 2.0
Background Removal written with swift using u2net model
License: Apache License 2.0
Hi, thanks a lot for your work, it's great, I'm finding it really useful.
I'm having an issue when I try to save image as Data:
let image = UIImage(named: "myImage")!
// transparent background
let resultImage = BackgroundRemoval().removeBackground(image: image)
let resultData = resultImage.pngData()!
// background is visible
let resultImage2 = UIImage(data: resultData)
In the previous example the resultImage2
image contains the original background.
Is background information really removed from the object? it seems like information is still saved in resultImage
for some reasons.
Hi,
I tried your example Improve results
but the result is The mask not the image after remove background
how can I get the image itself without background ?
let out = UIImage(pixelBuffer: result!.out_p1)
This line causes entire app to crash with certain images.
Recommend switching corresponding lines to:
guard let in0 = buffer(from: resize) else {
return nil
}
guard let result = try? model?.prediction(in_0: in0) else {
return nil
}
guard let out = UIImage(pixelBuffer: result.out_p1) else {
return nil
}
When i am saving the output image into the phone's album it is saving the original image. Image with the background. Can you please check this ?
Hi, thanks for the great work you've done with this library!
Images passed to the model are cropped to be square.
I've tried handing it portrait images, but then it crashes.
Is it only able to handle square images?
When trying to install via SPM, it gives an error that it can't resolve the package.
How I can get an updated image with the proper size and dimension?
I couldn't get the background less image to save. Background re-appears.
image = BackgroundRemoval.init().removeBackground(image: inputImage)
This shows image without background. Perfectly:
Image(uiImage: image!)
But when I try to save, the image magically somehow still has the background.:
guard
let data = image.pngData(),
let url = getUrlForImage(imageName: imageName, folderName: FolderName)
else {return}
do{
try data.write(to: url)
}catch let error {
print("Error saving image. ImageName:(imageName): (error)")
}
Also when I observe the image object it still has background . (If I load a background less image from camera roll it behaves differently . It saves without background and also if I observe the object it does not has the background)
Please let me know what I'm doing wrong here.
Hi everyone. Do you know? have alternative of BackgroundRemoval for android? if anyone has example can share with us?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.