zzj403 / BEV_Robust

[CVPR 2023] Understanding the Robustness of 3D Object Detection With Bird's-Eye-View Representations in Autonomous Driving
Apache License 2.0
21 stars 2 forks source link

你好,贴补丁时说要填写file to patch #1

Open wtn98498 opened 7 months ago

wtn98498 commented 7 months ago

你好,照着你的readme操作,在进行贴补丁后出现如下代码 patch -p1 < ../transfusion_changes.patch can't find file to patch at input line 5 Perhaps you used the wrong -p or --strip option? The text leading up to this was:

|diff --git a/.gitignore b/.gitignore |index 912d430..d61ecc8 100644 |--- a/.gitignore |+++ b/.gitignore

File to patch: 这让我输入什么,我咨询ai说是要改这个patch里边的路径,我不太懂,希望可以解答一下

zzj403 commented 7 months ago

Hi there, I do this patch on a new server. It works well for me. See:

(base) zhuzijian@d04:~/mycode/github$ git clone git@github.com:zzj403/BEV_Robust.git
Cloning into 'BEV_Robust'...
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 54 (delta 19), reused 41 (delta 12), pack-reused 0
Receiving objects: 100% (54/54), 119.20 KiB | 241.00 KiB/s, done.
Resolving deltas: 100% (19/19), done.
(base) zhuzijian@d04:~/mycode/github$ cd BEV_Robust/
(base) zhuzijian@d04:~/mycode/github/BEV_Robust$ 
(base) zhuzijian@d04:~/mycode/github/BEV_Robust$ git submodule update --init --recursive
Submodule 'BEVDet' (https://github.com/HuangJunJie2017/BEVDet) registered for path 'BEVDet'
Submodule 'BEVFormer' (https://github.com/fundamentalvision/BEVFormer) registered for path 'BEVFormer'
Submodule 'TransFusion' (https://github.com/XuyangBai/TransFusion) registered for path 'TransFusion'
Submodule 'bevfusion' (https://github.com/mit-han-lab/bevfusion) registered for path 'bevfusion'
Submodule 'detr3d' (https://github.com/WangYueFt/detr3d) registered for path 'detr3d'
Submodule 'mmdetection3d' (https://github.com/open-mmlab/mmdetection3d) registered for path 'mmdetection3d'
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/BEVDet'...
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/BEVFormer'...
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/TransFusion'...
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/bevfusion'...
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/detr3d'...
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/mmdetection3d'...
Submodule path 'BEVDet': checked out '2919b997c8fb2cb4737fd844200936ef04900d37'
Submodule path 'BEVFormer': checked out '074e3688cc4fa30dd4de3ac034227f125b61157e'
Submodule path 'TransFusion': checked out '73c596f7bd3460c17cbcc58dd9bcc5a0896774a8'
Submodule path 'bevfusion': checked out '0e5b9edbc135bf297f6e3323249f7165b232c925'
Submodule path 'detr3d': checked out '34a47673011fe13593a3e594a376668acca8bddb'
Submodule 'mmdetection3d' (git@github.com:open-mmlab/mmdetection3d.git) registered for path 'detr3d/mmdetection3d'
Cloning into '/data/zhuzijian/mycode/github/BEV_Robust/detr3d/mmdetection3d'...
Submodule path 'detr3d/mmdetection3d': checked out '60ce864ff76af4316fb9ae56a2a5b7741bfdd9ab'
Submodule path 'mmdetection3d': checked out '0f9dfa97a35ef87e16b700742d3c358d0ad15452'
(base) zhuzijian@d04:~/mycode/github/BEV_Robust$ cd TransFusion/
(base) zhuzijian@d04:~/mycode/github/BEV_Robust/TransFusion$ patch -p1 < ../transfusion_changes.patch
patching file .gitignore
patching file configs/transfusion_nusc_voxel_LC_adv.py
patching file configs/transfusion_nusc_voxel_LC_instancetoken.py
patching file extend/__init__.py
patching file extend/custom_func.py
patching file extend/func_for_patchinfo.py
patching symbolic link extend_common
patching file mmdet3d/apis/test_save_instance_patch_mask.py
patching file mmdet3d/apis/test_save_patch_info.py
patching symbolic link mmdet3d/apis_common
patching file mmdet3d/datasets/__init__.py
patching file mmdet3d/datasets/custom_3d.py
patching file mmdet3d/datasets/nuscenes_dataset.py
patching file mmdet3d/datasets/nuscenes_dataset_backup.py
patching file mmdet3d/datasets/nuscenes_dataset_with_instancetoken.py
patching file mmdet3d/datasets/pipelines/loading.py
patching file mmdet3d/models/detectors/transfusion.py
patching file mmdet3d/models/middle_encoders/sparse_encoder.py
patching file mmdet3d/ops/voxel/src/scatter_points_cuda.cu
patching file mmdet3d/ops/voxel/src/voxelization.h
patching file mmdet3d/ops/voxel/src/voxelization_cpu.cpp
patching file mmdet3d/ops/voxel/src/voxelization_cuda.cu
patching file mmdet3d/ops/voxel/src_backup/scatter_points_cpu.cpp
patching file mmdet3d/ops/voxel/src_backup/scatter_points_cuda.cu
patching file mmdet3d/ops/voxel/src_backup/voxelization.cpp
patching file mmdet3d/ops/voxel/src_backup/voxelization.h
patching file mmdet3d/ops/voxel/src_backup/voxelization_cpu.cpp
patching file mmdet3d/ops/voxel/src_backup/voxelization_cuda.cu
patching file mmdet3d/ops/voxel/voxelize.py
patching file mmdet3d/ops/voxel/voxelize_backup.py
patching file tools/test_fgsm_img_launcher.py
patching file tools/test_patch_class_launcher.py
patching file tools/test_patch_instance_launcher.py
patching file tools/test_patch_overlap_launcher.py
patching file tools/test_patch_temporal_launcher.py
patching file tools/test_pgd_img_launcher.py
patching file tools/test_pgd_imgpoint_launcher.py
patching file tools/test_save_instance_patch_mask_launcher.py
patching file tools/test_save_patch_info_launcher.py
patching file tools/test_scatterd_eval.py
(base) zhuzijian@d04:~/mycode/github/BEV_Robust/TransFusion$ 
wtn98498 commented 7 months ago

谢谢,原来文件夹是空的,要去下载,这个问题已解决 现在我们又遇到了新问题,我想借用你的补丁去攻击我自己的图片,请问你能给些建议么,十分感谢

zzj403 commented 7 months ago

If you still want to attack "Car" class, I suggest you to use class (or called category) attack, and add patch save function in the attack code. [we do not write this part in our code]. With this patch, you can attach it on your image, with F.affine_grid function in pytorch.

However, our attack is NOT designed for adversarial purpose, it aims for model evaluation, so it may not be suitable to directly use our patch in adversarial attack. You may add new design, like EOT, to enhance the transferability of the adversarial patcheds