Coder Social home page Coder Social logo

Random Mask Generation about lama HOT 11 CLOSED

advimman avatar advimman commented on August 21, 2024
Random Mask Generation

from lama.

Comments (11)

windj007 avatar windj007 commented on August 21, 2024 2

When I needed to quickly draw a mask, I used GIMP several times - just load an image, create another transparent layer, draw a mask there and save it to a separate file. Note that all masks must be strictly binary before feeding them to LaMa - thus if you make them with GIMP, you need a separate binarization step (that's pretty easy to do with cv2 and plain numpy).

from lama.

windj007 avatar windj007 commented on August 21, 2024 1

I'm not sure that I understand the question right... For better quality, the mask should cover an object and maybe a bit more - even tiny unmasked parts may result in artifacts. However, mask must not follow object boundaries - LaMa does not depend on its shape - it sees only unmasked areas and tries to regenerate the image based only on the available information. LaMa does not refine mask shape in any way. Does this answer your question? If not, could you please clarify it?

from lama.

windj007 avatar windj007 commented on August 21, 2024

Hi! Could you please describe your problem in more detail? What link is broken?

If you have an environment set up, you can use script

bin/gen_mask_dataset.py configs/data_gen/<config_name>.yaml \
    <dir with input images> <where to store image crops and masks>

Alternatively, there is a convenience wrapper via docker - please refer to the readme.

from lama.

ZeeRizvee avatar ZeeRizvee commented on August 21, 2024

Thank you for the help! Is there also an option to draw the mask on top of the image, like the one which is used in Google Colab demo?

from lama.

windj007 avatar windj007 commented on August 21, 2024

No, we do not provide any UI except those in Colab.

from lama.

windj007 avatar windj007 commented on August 21, 2024

You can try third-party apps, e.g. lama-cleaner.

from lama.

ZeeRizvee avatar ZeeRizvee commented on August 21, 2024

Thank you so much for the help and advice! Much appreciated :)

from lama.

ZeeRizvee avatar ZeeRizvee commented on August 21, 2024

@windj007 just another small query related to masks. As it can be seen in the Colab demo and lama-cleaner implementation, does the original LaMa repository also have the ability to recognize and stick with the main features in the original image even if the created mask does not perfectly align? If so, can you please point me towards the script which is performing this function?

from lama.

windj007 avatar windj007 commented on August 21, 2024

Note about mask binarization: predict.py actually does binarization - I forgot about this line. But anyway, as stated in another issue, having smooth masks is meaningless and it's better to control it manually.

from lama.

ZeeRizvee avatar ZeeRizvee commented on August 21, 2024

My apologies for not being able to ask the question clearly. But you have answered quite elaborately and my confusion is clear now. Thank you for the clarification!

from lama.

windj007 avatar windj007 commented on August 21, 2024

You're welcome!

from lama.

Related Issues (20)

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.