Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDA numpy implementation not in line with the paper. #36

Open
themurtazanazir opened this issue Oct 20, 2021 · 0 comments
Open

FDA numpy implementation not in line with the paper. #36

themurtazanazir opened this issue Oct 20, 2021 · 0 comments

Comments

@themurtazanazir
Copy link

Bug

The border b in FDA numpy implementation https://github.com/YanchaoYang/FDA/blob/master/utils/__init__.py#L64 is taken as min(height, width)*beta which is not in line with the paper.

To quote the paper:

As we can see from Eq. (3), $\beta = 0$ will render $x^{s→t}$ the same as the original source image $x^s$. On the other hand, when $\beta = 1.0$, the amplitude of $x^s$ will be replaced by that of $x^t$.

But while setting the beta=1, we get almost the original source image back. Also, setting beta=1 should replace all amplitude not just along the smaller axis.

To Reproduce

Steps to reproduce the behavior:

betas = [0.001, 0.1, 0.5, 0.8, 0.9, 1.0]

f, axes = plt.subplots(3, 2, figsize=(30, 20))

for beta,ax  in zip(betas, axes.ravel()):
    
    image = FDA_source_to_target_np(src, tar , L=beta)
    image = np.clip(image, 0, 255).astype(np.uint8)
    image = image.transpose(1,2,0)
    ax.imshow(image)
    ax.set_title(f"L: {beta}")
    ax.set_axis_off()
    
f.tight_layout()

Output

FDA bug in orig

Expected behavior

The "augmentation" should be maximum at beta=1 not at beta=0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant