-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a3f1d4
commit 6e2f11d
Showing
18 changed files
with
2,792 additions
and
2 deletions.
There are no files selected for viewing
Submodule Img-Diff
deleted from
34538b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Img-Diff: Contrastive Data Syhthesis for Multimodal Large Language Models | ||
|
||
|
||
## Environment | ||
|
||
``` | ||
transformers==4.36.2 | ||
``` | ||
|
||
For the other requirements, please refer to [LLaVA](https://github.com/haotian-liu/LLaVA/tree/main) and [Prompt-to-Prompt](https://github.com/google/prompt-to-prompt/). | ||
|
||
|
||
|
||
|
||
|
||
## Image Pairs Generator | ||
|
||
### step1 : generate caption pairs | ||
|
||
```shell | ||
# Img_Diff/pairs_generator/ | ||
$ bash gen.sh | ||
``` | ||
|
||
|
||
|
||
### step2 : generate image pairs | ||
|
||
```shell | ||
# Img_Diff/pairs_generator/ | ||
$ bash gen_sdxl_new_data_ddp.sh | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
## Object Replacement Data Generator | ||
|
||
### step1 : calculate image similarity | ||
|
||
```shell | ||
# Img_Diff/object_replacement/ | ||
$ bash cos_filter.sh | ||
``` | ||
|
||
|
||
|
||
### step2 : image similarity filter | ||
|
||
```shell | ||
# Img_Diff/object_replacement/ | ||
$ python cos_count.py | ||
``` | ||
|
||
|
||
|
||
### step3 : generate difference area | ||
|
||
```shell | ||
# Img_Diff/object_replacement/ | ||
$ bash generate_bbox.sh | ||
``` | ||
|
||
|
||
|
||
### step4 : generate difference captions | ||
|
||
```shell | ||
# Img_Diff/object_replacement/ | ||
$ bash generate_final_data_new_edit.sh | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
## Object Removal Data Generator | ||
|
||
```shell | ||
# Img_Diff/object_removal/ | ||
$ bash run_generate_inpaint.sh | ||
``` | ||
|
Oops, something went wrong.