MCPcopy Create free account

hub / github.com/ChenWu98/agent-attack / functions

Functions246 in github.com/ChenWu98/agent-attack

↓ 1 callersFunctionedit_distance
(s1, s2)
agent_attack/attacks/utils.py:11
↓ 1 callersFunctionencode_image
(image)
agent_attack/models/claude.py:22
↓ 1 callersFunctionencode_image
(image)
agent_attack/models/gemini.py:47
↓ 1 callersFunctionencode_image
(image)
agent_attack/models/gpt4v.py:25
↓ 1 callersMethodend_attack
theta: original_patch theta_hat: now patch in optimizer theta = theta + ksi*(theta_hat - theta), so: theta =(1-ksi )t
agent_attack/attacks/clip_attack.py:467
↓ 1 callersMethodgenerate_answer
( self, images: List[Image.Image], question_prompts: List[str], return_string_
agent_attack/models/claude.py:91
↓ 1 callersMethodgenerate_answer
( self, images: List[Image.Image], question_prompts: List[str], return_string_
agent_attack/models/gpt4v.py:94
↓ 1 callersFunctiongenerate_data
()
misc/synthetic.py:177
↓ 1 callersMethodgetMask
(self, ref: str)
agent_attack/util/loading/refer.py:329
↓ 1 callersMethodgetRefBox
(self, ref_id)
agent_attack/util/loading/refer.py:274
↓ 1 callersFunctionget_adversarial_images
()
misc/synthetic.py:82
↓ 1 callersFunctionget_base_example_dir
(example_dir: str)
agent_attack/data/attack_data.py:17
↓ 1 callersFunctionget_best_idx
(all_captions, target_caption_clip, victim_caption_clip)
scripts/run_clip_attack.py:136
↓ 1 callersMethodget_captioning_calib_prompt_fn
(self, calib_fn: str)
agent_attack/models/llava.py:199
↓ 1 callersMethodget_captioning_calib_prompt_fn
(self, calib_fn: str)
agent_attack/models/instructblip.py:113
↓ 1 callersMethodget_captioning_prompt_fn
Generates the full reference prompt for captioning tasks.
agent_attack/models/gpt4v.py:83
↓ 1 callersFunctionget_clean_images_and_content
()
misc/synthetic.py:96
↓ 1 callersFunctionget_content
(obs_text: str, som_id: int)
misc/synthetic.py:67
↓ 1 callersFunctionget_examples
(traj_root)
agent_attack/data/clean_data.py:20
↓ 1 callersMethodget_grad
(self, x, y, model)
agent_attack/attacks/clip_attack.py:494
↓ 1 callersFunctionget_image
(path: str = "image.jpg")
agent_attack/util/image_handling.py:57
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack_eval_refine_attack_only.py:271
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack.py:228
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack_tree_search_attack_only.py:254
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack_tree_search_attack.py:254
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack_eval_refine_attack.py:271
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack_tree_search.py:254
↓ 1 callersFunctionget_url
(obs_text: str, som_id: int)
scripts/eval_pipeline_attack_eval_refine.py:265
↓ 1 callersFunctionload
(example: dict, use_caption: bool)
scripts/eval_step.py:178
↓ 1 callersFunctionload
(example: dict, attack: str, use_caption: bool, args)
scripts/eval_step_attack.py:202
↓ 1 callersMethodload
Loads model and processors (InstructBLIPProcessor contains Vicuna Tokenizer, Q-Former Tokenizer, and an ImageProcessor) using the HF
agent_attack/models/instructblip.py:76
↓ 1 callersMethodloadRefs
(self, ref_ids=None)
agent_attack/util/loading/refer.py:241
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack_eval_refine_attack_only.py:278
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack.py:236
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack_tree_search_attack_only.py:261
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack_tree_search_attack.py:261
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack_eval_refine_attack.py:278
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack_tree_search.py:261
↓ 1 callersFunctionload_adv
(task_id, attack)
scripts/eval_pipeline_attack_eval_refine.py:272
↓ 1 callersFunctionmain
()
scripts/paraphrase_captions.py:56
↓ 1 callersMethodmodel_distribute
make each model on one gpu :return:
agent_attack/attacks/clip_attack.py:254
↓ 1 callersFunctionnormalize_question_suffix
(question_suffix: str)
agent_attack/models/instructblip.py:19
↓ 1 callersFunctionparaphrase_caption
Sends the caption to OpenAI API to get a paraphrased version.
scripts/paraphrase_captions.py:10
↓ 1 callersMethodperturb
(self, x)
agent_attack/attacks/clip_attack.py:397
↓ 1 callersFunctionpgd
(model, image, inputs, outputs, epsilon=16 / 255, alpha=1 / 255, iters=4000, size=1024)
agent_attack/attacks/pgd.py:18
↓ 1 callersFunctionprocess_caption_file
Reads the original caption, paraphrases it, and saves the result.
scripts/paraphrase_captions.py:30
↓ 1 callersFunctionremove_caption
(obs_text: str)
misc/synthetic.py:62
↓ 1 callersFunctionreplace_target_caption
(obs_text: str, som_id: Union[int, List[int]], target_caption: str)
scripts/eval_step_attack.py:191
↓ 1 callersFunctionrun
(args: argparse.Namespace, dataset)
scripts/run_cap_attack.py:57
↓ 1 callersFunctionrun
(args: argparse.Namespace, dataset)
scripts/run_clip_attack.py:150
↓ 1 callersFunctionsave_image
(x: Tensor, path="./0.png")
agent_attack/util/image_handling.py:24
↓ 1 callersFunctionsave_list_images
(xs: List, folder_path="./debug/", begin_id: int = 0)
agent_attack/util/image_handling.py:38
↓ 1 callersMethodset_ground_truth
(self, x: str)
agent_attack/surrogates/FeatureExtractors/Base.py:66
↓ 1 callersMethodset_victim_text
(self, x: str)
agent_attack/surrogates/FeatureExtractors/Base.py:73
↓ 1 callersMethodshowRef
(self, ref: str, seg_box: str = "seg")
agent_attack/util/loading/refer.py:278
↓ 1 callersFunctionshow_image
(x: Tensor)
agent_attack/util/image_handling.py:14
↓ 1 callersFunctiontake_action_and_score
Take the given actions and score the resulting trajectory.
scripts/eval_pipeline_attack_tree_search_attack_only.py:486
↓ 1 callersFunctiontake_action_and_score
Take the given actions and score the resulting trajectory.
scripts/eval_pipeline_attack_tree_search_attack.py:484
↓ 1 callersFunctiontake_action_and_score
Take the given actions and score the resulting trajectory.
scripts/eval_pipeline_attack_tree_search.py:473
Method__call__
(self, *args, **kwargs)
agent_attack/attacks/clip_attack.py:251
Method__call__
(self, action, criterion)
agent_attack/eval/step.py:46
Method__call__
(self, feature: Tensor, y: Any = None)
agent_attack/surrogates/FeatureExtractors/Base.py:47
Method__call__
(self, feature: Tensor, y: Any = None)
agent_attack/surrogates/FeatureExtractors/Base.py:79
Method__call__
(self, feature: Tensor, y: Any = None)
agent_attack/surrogates/FeatureExtractors/Base.py:122
Method__call__
(self, text: Union[str, Sequence[str]], return_tensors: str = "pt", **kwargs)
agent_attack/util/interfaces.py:20
Method__call__
(self, img: Image, **kwargs)
agent_attack/util/interfaces.py:34
Method__call__
(self, samples, concept, anti_concept)
scripts/run_clip_attack.py:108
Method__init__
(self, model: List[torch.nn.Module], epsilon=16 / 255, norm="Linf")
agent_attack/attacks/clip_attack.py:237
Method__init__
( self, model: List[nn.Module], total_step: int = 10, random_start: bool = Fal
agent_attack/attacks/clip_attack.py:293
Method__init__
(self)
agent_attack/eval/step.py:29
Method__init__
(self)
agent_attack/surrogates/FeatureExtractors/ViT.py:16
Method__init__
(self, model_path: str = "openai/clip-vit-base-patch32")
agent_attack/surrogates/FeatureExtractors/Clip.py:99
Method__init__
(self)
agent_attack/surrogates/FeatureExtractors/Blip.py:22
Method__init__
(self)
agent_attack/surrogates/FeatureExtractors/Base.py:9
Method__init__
(self, extractors: List[BaseFeatureExtractor])
agent_attack/surrogates/FeatureExtractors/Base.py:19
Method__init__
(self, extractors: List[BaseFeatureExtractor], count_to_index: Callable, feature_loss=nn.MSELoss())
agent_attack/surrogates/FeatureExtractors/Base.py:32
Method__init__
( self, extractors: List[BaseFeatureExtractor], count_to_index: Callable, feat
agent_attack/surrogates/FeatureExtractors/Base.py:92
Method__init__
( self, hub_path: Path, max_length: int = 512, temperature: float = 0.0,
agent_attack/models/claude.py:54
Method__init__
( self, hub_path: Path, max_length: int = 512, temperature: float = 0.2,
agent_attack/models/llava.py:39
Method__init__
( self, hub_path: Path, max_length: int = 512, temperature: float = 1.0,
agent_attack/models/gemini.py:63
Method__init__
( self, hub_path: Path, max_length: int = 512, temperature: float = 0.2,
agent_attack/models/instructblip.py:26
Method__init__
( self, hub_path: Path, max_length: int = 512, temperature: float = 0.0,
agent_attack/models/gpt4v.py:48
Method__init__
Provide `data_root` folder which contains `refclef`, `refcoco`, `refcoco+`, and `refcocog`. Additionally provide `dataset` name and `
agent_attack/util/loading/refer.py:52
Method__init__
( self, model_name, )
scripts/run_clip_attack.py:91
Methodattack
The attack algorithm of our proposed Spectrum Simulate Attack :param images: the input images :param gt: ground-truth
agent_attack/attacks/clip_attack.py:318
Methodattack
( self, x, y, )
agent_attack/attacks/clip_attack.py:402
Methodbatch_decode
(self, output_ids: Union[torch.Tensor, Sequence[Sequence[int]]], **kwargs)
agent_attack/util/interfaces.py:29
Functioncaptioning_fn
(images)
agent_attack/models/__init__.py:37
Methodcaptioning_prompt_fn
()
agent_attack/models/claude.py:83
Methodcaptioning_prompt_fn
()
agent_attack/models/gemini.py:93
Methodcaptioning_prompt_fn
()
agent_attack/models/instructblip.py:103
Methodcaptioning_prompt_fn
()
agent_attack/models/gpt4v.py:86
Functionclip_by_tensor
clip_by_tensor :param t: tensor :param t_min: min :param t_max: max :return: cliped tensor
agent_attack/attacks/clip_attack.py:213
Functiondct_3d
3-dimentional Discrete Cosine Transform, Type II (a.k.a. the DCT) For the meaning of the parameter `norm`, see: https://docs.scipy.org/d
agent_attack/attacks/clip_attack.py:174
Methodforward
(self, x)
agent_attack/surrogates/FeatureExtractors/ViT.py:26
Methodforward
(self, x)
agent_attack/surrogates/FeatureExtractors/Clip.py:119
Methodforward
(self, x)
agent_attack/surrogates/FeatureExtractors/Blip.py:36
Methodforward
(self, x: Tensor)
agent_attack/surrogates/FeatureExtractors/Base.py:14
Methodforward
(self, x: Tensor)
agent_attack/surrogates/FeatureExtractors/Base.py:23
Methodforward
( self, pixel_values: torch.Tensor, questions: List[str], answers: List[str],
agent_attack/models/instructblip.py:229
← previousnext →101–200 of 246, ranked by callers