RjDuan / AdvCam-Hide-Adv-with-Natural-Styles

Code for "Adversarial Camouflage: Hiding Physical World Attacks with Natural Styles" (CVPR 2020)
87 stars 20 forks source link

Problem about segmented image #24

Open zmr66z6xx6 opened 6 days ago

zmr66z6xx6 commented 6 days ago

Excuse me, Is it necessary to construct a segmented image for each sample to mask it? However, these require manual builds

RjDuan commented 5 days ago

Hi, glad you're interested in this work:D, Segmentation is not necessary, it's just for achieving better visual effects. For convenience, you can directly input a pure white image, and the entire image can be used to generate adversarial perturbations by default. zmr66z6xx6 @.***> 于2024年11月9日周六 16:08写道:

Excuse me, Is it necessary to construct a segmented image for each sample to mask it? However, these require manual builds

— Reply to this email directly, view it on GitHub https://github.com/RjDuan/AdvCam-Hide-Adv-with-Natural-Styles/issues/24, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEPNZZYDS4JGLFJEB3IMGDZ7W7IZAVCNFSM6AAAAABRO4JGS2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2DKNZYGYZTIOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

zmr66z6xx6 commented 5 days ago

Thanks a lot

zmr66z6xx6 commented 4 days ago

I also want to consult about the detail of the function in utils and some result about the experiment. style_seg = np.array(Image.open(args.style_seg_path).convert("RGB").resize((style_width, style_height), resample=Image.BILINEAR), dtype=np.float32) // 245.0 Why doesn't the above division use floating-point division and divide by 255? Furthermore,I ignore the physical attack and only care about digital attack, but the result is troubling! Following is the image generated in the 800 step: image

zmr66z6xx6 commented 4 days ago

@RjDuan

RjDuan commented 4 days ago

Hi, Q1: style_seg = np.array(Image.open(args.style_seg_path).convert("RGB").resize((style_width, style_height), resample=Image.BILINEAR), dtype=np.float32) // 245.0 Why doesn't the above division use floating-point division and divide by 255? A1: It's been so long that I've forgotten why I wrote it as 245... However, there should be no difference in the results between 245 and 255? Q2: About the digital attack and the generated adv. image. A2: On one hand, it seems that the style of this image didn't load successfully, or the style loss is set too low? On the other hand, if it's just a digital attack, I think even 100 steps would be sufficient for success?

zmr66z6xx6 @.***> 于2024年11月10日周日 23:18写道:

@RjDuan https://github.com/RjDuan

— Reply to this email directly, view it on GitHub https://github.com/RjDuan/AdvCam-Hide-Adv-with-Natural-Styles/issues/24#issuecomment-2466774203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEPNZYF2WIEGWPHWUF7SWDZ752NXAVCNFSM6AAAAABRO4JGS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWG43TIMRQGM . You are receiving this because you were mentioned.Message ID: @.*** com>

zmr66z6xx6 commented 4 days ago

The parameter setting should be based on the default value in the main code, right? @RjDuan

zmr66z6xx6 commented 4 days ago

Hi, Q1: style_seg = np.array(Image.open(args.style_seg_path).convert("RGB").resize((style_width, style_height), resample=Image.BILINEAR), dtype=np.float32) // 245.0 Why doesn't the above division use floating-point division and divide by 255? A1: It's been so long that I've forgotten why I wrote it as 245... However, there should be no difference in the results between 245 and 255? Q2: About the digital attack and the generated adv. image. A2: On one hand, it seems that the style of this image didn't load successfully, or the style loss is set too low? On the other hand, if it's just a digital attack, I think even 100 steps would be sufficient for success? zmr66z6xx6 @.> 于2024年11月10日周日 23:18写道: @RjDuan https://github.com/RjDuan — Reply to this email directly, view it on GitHub <#24 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEPNZYF2WIEGWPHWUF7SWDZ752NXAVCNFSM6AAAAABRO4JGS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWG43TIMRQGM . You are receiving this because you were mentioned.Message ID: @. com> But for the division,Why use "//"? Shouldn't it be mapped to a 0-1 interval at the end? The result is 0 and 1