Skip to content

Commit

Permalink
upload code
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyBanana committed Dec 20, 2024
1 parent 7a3f1d4 commit 6e2f11d
Show file tree
Hide file tree
Showing 18 changed files with 2,792 additions and 2 deletions.
1 change: 0 additions & 1 deletion Img-Diff
Submodule Img-Diff deleted from 34538b
84 changes: 84 additions & 0 deletions Img-Diff-codes/README.md
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
```

Loading

0 comments on commit 6e2f11d

Please sign in to comment.