Skip to content

Improve NumPy Broadcasting Stability #55

Description

@powderblock

Occasionally when trying to do the glasses manipulation where we go from the small res image to the full res image, I will receive the following error:
" File "bot.py", line 249, in
process_image(str(post.url), frame, eyes_to_use)
File "bot.py", line 109, in process_image
bg += smallglasses[:, :, 0:3] * np.atleast_3d(smallglasses[:, :, 3])
ValueError: operands could not be broadcast together with shapes (62,248,4) (62,248,3) (62,248,4)"
I think has to do with how we are trying to broadcast an x,x,3 with two x,x,4s?

This StackOverflow question pretty much explains the issue, but I am still having trouble understanding exactly what I need to do to fix the issue.

@porglezomp knows more about NumPy manipulation than I do.
Wanna take this one, porglezomp?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions