flowattack icon indicating copy to clipboard operation
flowattack copied to clipboard

Scores of provided patches

Open andraghetti opened this issue 4 years ago • 1 comments

Hi, thank you for the code.

I tried to run test_path.py on the provided patch with a tiny change on the code in order to the patch as png instead of the format you dump during training.

The change is here, instead of patch = torch.load(args.patch_path)

im = np.array(Image.open(args.patch_path).convert('RGB'))
im = np.transpose(im, (2, 0, 1))
im = np.expand_dims(im, 0)
patch = torch.from_numpy(im)
patch_init = torch.from_numpy(im)

I tested both Upatch1 and Upatch2 on FlowNetC with this command: python test_patch.py --patch_path patches/Upatch.png --flownet FlowNetC. (--name is not important)

  1. upatch1:
    epe,    adv_epe,    cos_sim, adv_cos_sim
14.5157,    34.4716,     0.8562,     0.4959
  1. upatch2:
    epe,    adv_epe,    cos_sim, adv_cos_sim
14.5157,    17.7255,     0.8562,     0.7827

These patches sizes don't have any comparison with the paper and it seems that they don't affect much the prediction. Especially because here the flow inside the patch is considered, while it shouldn't. Can you please provide your results or more patches with the smallest and biggest dimensions?

Thank you!

Edit: I ran the test on the second patch with --ignore_flow_mask=true:

    epe,    adv_epe,    cos_sim, adv_cos_sim
14.5157,    17.7804,     0.8562,     0.7963

andraghetti avatar Aug 09 '20 13:08 andraghetti

Oh, here you need to take care of the normalization of the patch properly. The raw saves of the patch are already normalized. The effect should be such that you are pasting the normalized patch on the image.

As far as I remember, the patch is normalized to [-1, 1]. This loading of png-image of the patch normalizes it to [0,1]. That should be taken care of.

anuragranj avatar Aug 10 '20 08:08 anuragranj