Skip to content

How to achieve a single call to apply when having multiple image targets #1410

Discussion options

You must be logged in to vote

I got an answer here: #1409 (comment).

Just copy pasting @i-aki-y's answer:

Albumentation has a mapping list from the argument key to the associated functions in the targets variable:

targets = {
    "image": apply_image,
    "bboxes": apply_bboxes,
    ...
}

The functions specified in the targets will be executed one by one when you apply trasform(image=image, bboxes=bboxes).

You have added new entries into the targets variable by using additional_targets

targets = {
    "image": apply_image,
    "bboxes": apply_bboxes,
    ...
    "image1": apply_image,
    ...
}

This means apply_image will be called twice; the first is for the "image", and the second is for the "image1".
I think thi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mikel-brostrom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant