In the process of data augmentation, I am trying to modify the image based on the corresponding mask. I need to get the background from the image, which requires knowing the foreground (mask) in advance.
Therefore, I am looking for a Transform that can provide image and mask as input to my function. For example, previously, I used ColorTransform, which takes a callable and provides an image as input to this callable. See an example below:
I found AugInput, but it expects image, mask, etc. as input. Instead, is there something like the following exists?
def my_transform(img, mask):
# do something on image using mask and return image
return img
...
def build_train_loader(cls, cfg):
augmentations = [
T.RandomFlip(),
T.CustomTransform(my_transform),
]
...
Thank you very much
Instructions To Reproduce the 🐛 Bug:
Full runnable code or full changes you made:
If making changes to the project itself, please use output of the following command:
git rev-parse HEAD; git diff
```
2. What exact command you run:
3. __Full logs__ or other relevant observations:
```
```
4. please simplify the steps as much as possible so they do not require additional resources to
run, such as a private dataset.
## Expected behavior:
If there are no obvious error in "full logs" provided above,
please tell us the expected behavior.
## Environment:
Provide your environment information using the following command:
```
wget -nc -q https://github.com/facebookresearch/detectron2/raw/main/detectron2/utils/collect_env.py && python collect_env.py
```
If your issue looks like an installation issue / environment issue,
please first try to solve it yourself with the instructions in
https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues
In the process of data augmentation, I am trying to modify the image based on the corresponding mask. I need to get the background from the image, which requires knowing the foreground (mask) in advance.
Therefore, I am looking for a
Transform
that can provide image and mask as input to my function. For example, previously, I used ColorTransform, which takes a callable and provides an image as input to this callable. See an example below:I found AugInput, but it expects image, mask, etc. as input. Instead, is there something like the following exists?
Thank you very much
Instructions To Reproduce the 🐛 Bug: