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 details)

Uploaded Source

File details

Details for the file fda-0.0.2.tar.gz.

File metadata

  • Download URL: fda-0.0.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.27.1 setuptools/62.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.10

File hashes

Hashes for fda-0.0.2.tar.gz
Algorithm Hash digest
SHA256 98909787906edd7df7fa27e61236c75f67e37656cd830d4f3d1211c8894ff28b
MD5 6cfaf3976d571e53747ce97f22d49fb2
BLAKE2b-256 2f6e0f0bd795ea11cad9e1596acfd6772df0a19de697d807813ca7f21d16550f

See more details on using hashes here.

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