birdManIkioiShota / ABaG

ABaG: Attention-Based Guide for grounded text-to-image generation

Home Page:https://AttendAndExcite.github.io/Attend-and-Excite/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ABaG: Attention-Based Guide for grounded text-to-image generation

Description

Attend-and-Exciteのlossを改造し、バウンディングボックスを用いた画像構図の操作を可能にします。
BBox内のAttention map平均値を高め、BBox外のAttention map最大値を低めるように潜在空間を調整するだけのアイデアです。

Usage

Example 1:

python run_abag.py --prompt "a mouse and a red car" --seeds [0] --token_indices [2,6] --bbox_txt_file ./bboxes/bbox1.txt --lr 0.6
bbox1.txt means generated image

Example 2:

python run_abag.py --prompt "a girl is eating pizza on desk" --seeds [0] --token_indices [2,5,7] --bbox_txt_file ./bboxes/bbox2.txt
bbox2.txt means generated image

Known Issue

  • lossが落ちてくれないときがある

lrをいじると落ちるときがあります。

  • lossが落ちてるのに構図がbbox通りにならないことがある

原因不明。Attention mapを見る限りBBox内の値が高く出てるんですが…

About

ABaG: Attention-Based Guide for grounded text-to-image generation

https://AttendAndExcite.github.io/Attend-and-Excite/


Languages

Language:Jupyter Notebook 98.5%Language:Python 1.5%