sled-group / InfEdit

[CVPR 2024] Official implementation of CVPR 2024 paper: "Inversion-Free Image Editing with Natural Language"
https://sled-group.github.io/InfEdit/
Other
242 stars 7 forks source link

The implementation of mapper #21

Closed fkcptlst closed 3 months ago

fkcptlst commented 3 months ago

Hello, I'm confused about the following code.

https://github.com/sled-group/InfEdit/blob/d9f6c1bcffdb25c163a4a8b4fc80467f08b2add5/seq_aligner.py#L152-L154

The code fragment before this snippet does the following things:

  1. search the most similar token in target prompt in a mismatch "gap" interval.
  2. fill the 0 in mapper with the index of the most similar token in the target prompt.

However, II'm confused about the code I pasted. Under what circumstances does the if statement satisfies?

SihanXU commented 3 months ago

Mentioned in https://github.com/sled-group/InfEdit/issues/22#issuecomment-2059717108