Code Monkey home page Code Monkey logo

backgroundremoval's Introduction

backgroundremoval's People

Contributors

asimcanyagiz avatar ezaldeen99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

backgroundremoval's Issues

Background still visible when I save UIImage as Data

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.

Nullability crash

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
        }

Background removal on portrait images

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?

SPM Broken

When trying to install via SPM, it gives an error that it can't resolve the package.

Image size and dimension problem

  • I have taken images from the camera (iPhone XR - W3024 X H4032)
  • Original image size was 3.5 MB
  • When I got an updated image (White background) the size was increased (6.7 MB)
  • Even file resolution was also changed (4032 X 4032)

How I can get an updated image with the proper size and dimension?

Image still has background? Save as PNG

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.

BgRemoval for android

Hi everyone. Do you know? have alternative of BackgroundRemoval for android? if anyone has example can share with us?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.