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

Add random_sharpness processing layer #20697

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shashaka
Copy link
Contributor

@shashaka shashaka commented Dec 28, 2024

I implemented the RandomSharpness image processing feature before working on rand_augment, as it includes related image processing functionalities.

Here is my gist

@codecov-commenter
Copy link

codecov-commenter commented Dec 28, 2024

Codecov Report

Attention: Patch coverage is 29.41176% with 48 lines in your changes missing coverage. Please review.

Project coverage is 81.88%. Comparing base (be1191f) to head (337c33f).

Files with missing lines Patch % Lines
...processing/image_preprocessing/random_sharpness.py 26.15% 48 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20697      +/-   ##
==========================================
- Coverage   81.95%   81.88%   -0.07%     
==========================================
  Files         546      547       +1     
  Lines       50966    51034      +68     
  Branches     7884     7893       +9     
==========================================
+ Hits        41768    41788      +20     
- Misses       7278     7326      +48     
  Partials     1920     1920              
Flag Coverage Δ
keras 81.71% <29.41%> (-0.07%) ⬇️
keras-jax 63.87% <29.41%> (-0.05%) ⬇️
keras-numpy 58.81% <29.41%> (-0.04%) ⬇️
keras-openvino 29.89% <29.41%> (-0.01%) ⬇️
keras-tensorflow 64.59% <29.41%> (-0.05%) ⬇️
keras-torch 63.93% <29.41%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

def transform_images(self, images, transformation=None, training=True):
if training:
if self.data_format == "channels_first":
images = self.backend.numpy.swapaxes(images, -3, -1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

{{function_node __wrapped__DepthwiseConv2dNative_device_/job:localhost/replica:0/task:0/device:CPU:0}} Depthwise convolution on CPU is only supported for NHWC format [Op:DepthwiseConv2dNative] name:

To resolve this error, I adjusted the image axis based on the data_format to ensure compatibility with the depthwise_conv operation. This adjustment was necessary because depthwise convolution on CPU is only supported in the NHWC format.

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

Successfully merging this pull request may close these issues.

3 participants