Skip to content

Using experimental images of particles for generation of training data #181

Answered by BenjaminMidtvedt
Yennda asked this question in Q&A
Discussion options

You must be logged in to vote

Ok! First, I'd change the pipeline slightly, to:

image_pipeline = dt.Value(lambda: np.zeros((IMAGE_SIZE, IMAGE_SIZE))) >> nanopars_noise

which allows you resolve the pipeline without giving it an argument.

Second, to get the mask, you can do:

# can  be any (W, H, 1) shape you want.
particle_mask = np.ones((1, 1, 1))

mask_pipeline = nanopars >> dt.SampleToMasks(
    lambda: lambda image: circle,
    output_region=optics.output_region,
    merge_method="or"
)
´´´

They can be combined and evaluated as follows:
```python
image_and_mask = image_pipeline & mask_pipeline

image, mask = image_and_mask.update().resolve()

image_and_mask can be directly fed to a deeptrack unet, or resolved many ti…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Yennda
Comment options

@BenjaminMidtvedt
Comment options

Answer selected by Yennda
@Yennda
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants