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

operands could not be broadcast together with shapes (288,400) (457,400) #15

Open
supernumber17 opened this issue May 29, 2024 · 0 comments

Comments

@supernumber17
Copy link

I've encountered the issue described in the title while running train.py. It seems to be coming from the Starburst_augment class in dataset.py, and I'm not sure what's going on. I hope to get help from a professional. Also, I downloaded the openEDS dataset from the Kaggle.(https://www.kaggle.com/datasets/soumicksarker/openeds-dataset)
`class Starburst_augment(object):
## We have generated the starburst pattern from a train image 000000240768.png
## Please follow the file Starburst_generation_from_train_image_000000240768.pdf attached in the folder
## This procedure is used in order to handle people with multiple reflections for glasses
## a random translation of mask of starburst pattern

def __call__(self, img):
    x = np.random.randint(1, 40)
    y = np.random.randint(1, 40)
    mode = np.random.randint(0, 2)
    starburst = Image.open('starburst_black.png').convert("L")
    if mode == 0:
        starburst = np.pad(starburst, pad_width=((0, 0), (x, 0)), mode='constant')
        starburst = starburst[:, :-x]
    if mode == 1:
        starburst = np.pad(starburst, pad_width=((0, 0), (0, x)), mode='constant')
        starburst = starburst[:, x:]

    img[92 + y:549 + y, 0:400] = np.array(img)[92 + y:549 + y, 0:400] * (
            (255 - np.array(starburst)) / 255) + np.array(starburst)
    return Image.fromarray(img)`
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