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

Weight Strategy fix. #734

Open
dchatel opened this issue Oct 9, 2024 · 0 comments
Open

Weight Strategy fix. #734

dchatel opened this issue Oct 9, 2024 · 0 comments

Comments

@dchatel
Copy link

dchatel commented Oct 9, 2024

As I mentioned on discord, lines from 1716 to 1732 in ipadapterplus.py can be replaced by this:

image_1 = image[:-1].repeat_interleave(frames, 0)
image_2 = image[1:].repeat_interleave(frames, 0)
weights = weights * (len(image) - 1)
weights_invert = weights[::-1]

In the current implementation, if you have images A,B,C and 4 frames per image, you'll get AAAACCCC and BBBBBBBB with weights 1 to 0 to 1 and 0 to 1 to 0.
With this change, you get AAAABBBB and BBBBCCCC with weights 1 to 0 repeating and 0 to 1 repeating.

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