Skip to main content

Package for doing a simple Fourier-based domain adaptation.

Project description

Fourier Domain Adaption (FDA)

This Python package implements a classic frequency domain adaptation, as shown in:

FDA: Fourier Domain Adaptation for Semantic Segmentation, Yanchao Yang and Stefano Soatto, CVPR 2020

Install with pip

$ python3 -m pip install fda --user

Install from source

$ python3 setup.py install --user

Exemplary code snippet

import fda

# Read source and target images
source_im = cv2.imread('source.jpg')
target_im = cv2.imread('target.jpg')

# Perform domain adaptation
adapted_im = fda.fda(source,_im, target_im, beta=0.005)

Run domain adaptation on a single image

$ python3 -m fda.run --source source.jpg --target target.jpg --output output.jpg --beta 0.005

Some examples of the domain adaptation

Source image Target domain image Beta Output
0.001
0.01
0.1
0.001
0.01
0.1
0.001
0.01
0.1

Run unit tests

$ python3 tests/test_fourier.py

License

This repository is shared under an MIT license.

Author

Luis Carlos Garcia Peraza Herrera (luiscarlos.gph@gmail.com), 2020-2022.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fda-0.0.2.tar.gz (5.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page