Closed TheLiao233 closed 1 month ago
The files attens_10_samples.json
and attens_100samples_255.json
can be generated from get_att.py
. The exact file names depend on the settings you configure in the get_att.py
.
To help you run the code, I have also uploaded some sample attens_... .json
files. Additionally, I have updated the README.md
to include a link for downloading the model file BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar
.
The WORDMAP_coco_5_cap_per_img_5_min_word_freq.json
file has also been uploaded for your convenience.
You can use the following steps to generate or use these files:
get_att.py
script based on your desired settings..json
files for sample attention results.README.md
.Please ensure that you have the following dependencies set up before running the codes:
BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar
(pre-trained model)WORDMAP_coco_5_cap_per_img_5_min_word_freq.json
(word map file)The files
attens_10_samples.json
andattens_100samples_255.json
can be generated fromget_att.py
. The exact file names depend on the settings you configure in theget_att.py
.To help you run the code, I have also uploaded some sample
attens_... .json
files. Additionally, I have updated theREADME.md
to include a link for downloading the model fileBEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar
.The
WORDMAP_coco_5_cap_per_img_5_min_word_freq.json
file has also been uploaded for your convenience.You can use the following steps to generate or use these files:
1. Configure and run the `get_att.py` script based on your desired settings. 2. Refer to the uploaded `.json` files for sample attention results. 3. Download the pre-trained model from the link provided in `README.md`.
Please ensure that you have the following dependencies set up before running the codes:
* `BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar` (pre-trained model) * `WORDMAP_coco_5_cap_per_img_5_min_word_freq.json` (word map file)
Thank you very much for your timely reply. There are still some problems:
1.Does each samples.json
used in the code differ only in num_input
, and what are the implications of using different files? The flicker8k
dataset is used by default in get_att.py
and the generated file has 384 in its name, but several other json files don't have enough information in their names to make it impossible to determine how to generate with the appropriate parameters. In particular, whether files with 255 in their names need to adjust the code of get_att.py
?
Specific documents are as follows:
attens_10samples.json
is used in the pick_atten.py
attens_100samples.json
is used in the main.py
attens_100samples_255.json
is used in the perturb_att.py
attens_flicker8k_1000samples_255.json
is used in the separate.py
2.After I generated the above files myself, the running result of attack_blip_test.py
is as follows. The loss and generated text are basically unchanged, is there any problem?
The BLIP model takes an input image size of 384 384, and SAT takes 255 255. Check the parameters you used for attacking BLIP, such as pixels
.
Hello, I would like to ask how should I get the
attens_10samples.json
file ofpick_atten.py
and theattens_100samples_255.json
ofperturb_att.py
. If you can, Could you please provide theBEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar
andWORDMAP_coco_5_cap_per_img_5_min_word_freq.json
ofget_att.py
Sincerely hope for your reply, thank you!