You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Albumentations package on Google Colab, transformations sometimes work as expected, but other times they fail without any changes to the code. This inconsistency occurs when running the same code multiple times.
To Reproduce
Steps to reproduce the behavior:
Run the same transformation code multiple times on Google Colab.
Observe that some executions succeed while others fail without any apparent reason.
Sample code that produces the bug:
importalbumentationsasAimportcv2importmatplotlib.pyplotasplt# Declare an augmentation pipelinetransform=A.Compose([
A.ToGray(num_output_channels=3, method="weighted_average")
])
# Read an image with OpenCV and convert it to the RGB colorspaceimage=cv2.imread("/path/to/image.png")
image=cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# Augment an imagetransformed=transform(image=image)
transformed_image=transformed["image"]
plt.figure(figsize=(8, 4))
plt.subplot(1, 2, 1)
plt.imshow(image)
plt.title("Original")
plt.axis("off")
plt.subplot(1, 2, 2)
plt.imshow(transformed_image)
plt.title("ToGray")
plt.axis("off")
plt.show()
Expected behavior
The transformations should work consistently across multiple runs without intermittent failures.
Actual behavior
The same transformation code sometimes works and sometimes does not.
Screenshots / GIF
issue.mp4
Additional context
When I use this package to generate data for a dataset and run a loop to apply transformations, some images get augmented while others do not.
The text was updated successfully, but these errors were encountered:
Default probability for ToGray is p=0.5, it is expected to get half of the images transformed in such case. If you want all images transformed => use `p=1``
Describe the bug
When using the Albumentations package on Google Colab, transformations sometimes work as expected, but other times they fail without any changes to the code. This inconsistency occurs when running the same code multiple times.
To Reproduce
Steps to reproduce the behavior:
Run the same transformation code multiple times on Google Colab.
Observe that some executions succeed while others fail without any apparent reason.
Sample code that produces the bug:
Expected behavior
The transformations should work consistently across multiple runs without intermittent failures.
Actual behavior
The same transformation code sometimes works and sometimes does not.
Screenshots / GIF
issue.mp4
Additional context
When I use this package to generate data for a dataset and run a loop to apply transformations, some images get augmented while others do not.
The text was updated successfully, but these errors were encountered: