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

ChangeColorTemperature() causes error: operands could not be broadcast together with shapes (32,) (32,3) on official example #850

Open
joej970 opened this issue May 17, 2024 · 0 comments

Comments

@joej970
Copy link

joej970 commented May 17, 2024

imgaug 0.4.0
python 3.11.5

example from: https://imgaug.readthedocs.io/en/latest/source/examples_basics.html

  import numpy as np
  import imgaug as ia
  import imgaug.augmenters as iaa

  ia.seed(1)
  
  # Example batch of images.
  # The array has shape (32, 64, 64, 3) and dtype uint8.
  images = np.array(
      [ia.quokka(size=(64, 64)) for _ in range(32)],
      dtype=np.uint8
  )
  
  seq = iaa.Sequential([
      iaa.Fliplr(0.5), # horizontal flips
      iaa.Crop(percent=(0, 0.1)), # random crops
      iaa.Sometimes(
          0.5,
          iaa.GaussianBlur(sigma=(0, 0.5))
      ),
      iaa.LinearContrast((0.75, 1.5)),
      iaa.AdditiveGaussianNoise(loc=0, scale=(0.0, 0.05*255), per_channel=0.5),
      iaa.Multiply((0.8, 1.2), per_channel=0.2),
      iaa.Affine(
          scale={"x": (0.8, 1.2), "y": (0.8, 1.2)},
          translate_percent={"x": (-0.2, 0.2), "y": (-0.2, 0.2)},
          rotate=(-25, 25),
          shear=(-8, 8)
      ),

      # Adding this throws error: operands could not be broadcast together with shapes (32,) (32,3) 
      iaa.ChangeColorTemperature((5000, 8000))
      # ERROR!!! 

      ], random_order=True) # apply augmenters in random order

images_aug = seq(images=images)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant