-
Notifications
You must be signed in to change notification settings - Fork 330
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
Custom data augmentation #1570
Comments
Hey @kmr2017 thanks for your inquiry. Can you check out: https://keras.io/guides/keras_cv/retina_net_overview/ to see how to use OD augmentations? |
@LukeWood I check that, but I am unable to add custom data augemtnaiton to below code: augment = keras_cv.layers.Augmenter( Can you help me to add custom data augmentation? Thanks, |
What do you mean by custom? Lets re-phrase the question a bit, as I think I am missing the issue. |
I mean I want to add custom data augmentation layer to the above code, how can I add? |
have you implemented a custom augmentation? https://keras.io/guides/keras_cv/custom_image_augmentations/ If you share the code you'd ideally like to achieve, that would clarify it a lot. Its not clear what the issue or hold up is. You can run any TensorFlow code the pipeline! |
Here my code, I am writing code to find the saliencyPart (findSaliency) in class SaleincyAug and I added ' SaleincyAug' in augment. Data loading and model from link: https://github.com/keras-team/keras-io/blob/master/guides/keras_cv/retina_net_overview.py Code import tensorflow as tf def FindSaliency(img):temp_img = img.copy() saliency = cv2.saliency.StaticSaliencyFineGrained_create() bbx1 = np.clip(x - cut_w // 2, 0, W) saliency_img = temp_img[bby1:bby2, bbx1:bbx2].copy() temp_img = cv2.resize(saliency_img, (H,W)) @tf.keras.utils.register_keras_serializable(package="keras_cv")class SaleincyAug(BaseImageAugmentationLayer):
augment = keras.Sequential(
) train_ds = train_ds.map( Error I am getting is: "AttributeError Traceback (most recent call last) 29 frames AttributeError: in user code:
" |
Hi @LukeWood Are you looking into above issue? I need this one. I have to perform experiments. Thanks, |
it looks like you are using |
Can you fix it? I tried, it is throwing same error. |
Apologies @kmr2017, I do not have bandwidth to debug custom end user code - only KerasCV components. this is expected behavior. Try a using a py_function. Please feel free to re-open if you have a colab to share with issues regarding KerasCV! This is just expected behavior as of now! |
Hi
Thanks for your wonder KerasCV library.
I am working on custom data augmentation for object detection. I will want to apply that with keras_CV existing augmentation. Can you please suggest, how can I do that?
Lets say, I want to apply random erasing on saliency part. Can you help me?
Best regards,
Teerath Kumar
The text was updated successfully, but these errors were encountered: