Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blending] Smoke Randomization Starting Point #11

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

jpennors
Copy link
Collaborator

Create a module to get a random dx,dy starting point for smoke addition

@MateoLostanlen
Copy link
Member

Hi @jpennors , thnaks for your PR, can you fix the tests ? I'm looking at the code itself but you missing init files to make the package work properly

@MateoLostanlen
Copy link
Member

I recommend adding the following code:

from skimage import measure
blobs_labels = measure.label(mask, background=0)
s = [np.sum(blobs_labels==l) for l in np.unique(blobs_labels)[1:]]
mask = blobs_labels==(np.where(s==np.max(s))[0] + 1)

This will improve the mask by removing false detection like text in the corner for example

Copy link
Collaborator Author

@jpennors jpennors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @MateoLostanlen !
I did not know this lalelization package. It's actually working very well.

From :
image

To :
image

The code currently keeps the biggest label. We could have done it another way by picking the label which is the closest to the floor (meaning y=0). But I guess this is fine with our use cas 😄

@jpennors
Copy link
Collaborator Author

jpennors commented Jun 1, 2022

@MateoLostanlen I got weird failing tests :

  • Unable to resolve action gaurav-nelson/github-action-markdown-link-check@main, unable to find version main``
  • would reformat syntheticdataset/image_blending.py. I did not update this file, and I don't have any changes locally when running black ./
  • ModuleNotFoundError: No module named 'skimage'. It does'nt seem to install scikit-image, but I added in the requirements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants