Skip to main content

Möbius Perspective Distortion (MPD) data‑augmentation transform.

Reason this release was yanked:

bug

Project description

mobius‑mpd

Möbius Perspective Distortion (MPD) augmentation for PyTorch & Albumentations

Chhipa, Prakash Chandra, et al. "Möbius transform for mitigating perspective distortions in representation learning." European Conference on Computer Vision. Cham: Springer Nature Switzerland, 2024.

Möbius-MPD — Perspective-Distortion Augmentation



1 What is perspective distortion?

A camera viewed from an oblique pose changes the apparent shape, size, orientation and angles of objects in the image plane.:contentReference[oaicite:0]{index=0}


2 Why perspective distortion is troublesome for computer-vision models?

Camera parameters are hard to estimate, so PD can’t be synthesised easily for training.:contentReference[oaicite:1]{index=1}
Existing augmentation methods are affine and lienar in nature are not able to model perspective distortion.:contentReference[oaicite:2]{index=2}
Lack of perspective distortion data leaves models brittle in the wild for real-world applications—crowd counting, fisheye recognition, person re-ID and object detection all degrade when PD is present.:contentReference[oaicite:3]{index=3}


3 What does Möbius-MPD offer?

Möbius-MPD mathmetically models perspective distortion and translate it directly in pixel space with a conformal Möbius mapping

$$ \Phi(z)=\frac{a z + b}{c z + d}, \qquad c!=0 $$

and the real and imaginery compoents of complex parameter c controls the perspectively distorted view generations.

Orientation & intensity control – the signs and magnitudes of (\operatorname{Re}(c)) and (\operatorname{Im}(c)) yield left / right / top / bottom or corner views, scaled continuously.:contentReference[oaicite:4]{index=4}
No camera parameters or real PD images required – the transform alone synthesises realistic PD.:contentReference[oaicite:5]{index=5}
Padding variant – optionally fills black corners with edge pixels.:contentReference[oaicite:6]{index=6}
Proven gains – +10 pp on ImageNet-PD and improvements across crowd counting, fisheye recognition, person re-ID and COCO object detection.:contentReference[oaicite:7]{index=7}


Installation

pip install mobius-mpd

or in editable mode:

git clone https://github.com/prakashchhipa/mobius-mpd
cd mobius-mpd
pip install -e .

Usage

PyTorch / torchvision

from torchvision import transforms
from mobius_mpd import MobiusMPDTransform

train_aug = transforms.Compose([
    MobiusMPDTransform(
        p=0.5,      # apply 50% of the time
        min=0.1,    # minimum |c|
        max=0.3,    # maximum |c|
    ),
    transforms.ToTensor(),
])

Albumentations

import albumentations as A
from mobius_mpd import A_MobiusMPDTransform

aug = A.Compose([
    A_MobiusMPDTransform(p=0.7, min=0.05, max=0.25),
])

Parameters

name default description
p 1.0 probability of applying the transform
min 0.1 lower bound for the sampled coefficient (
max 0.3 upper bound for the sampled coefficient (
background "none" "none" → black corners · "padded" → edge-pixel padding
view_mode "random" "random", "uni-direction", or "bi-direction"
view "random" orientation; for uni: left / right / top / bottom · for bi: left-top / left-bottom / right-top / right-bottom

Examples for different configurations to generate different views. Set view and/or view_mode to random for augmentaiton purpose.

Background setting with and without padding.

Parent project page: https://prakashchhipa.github.io/projects/mpd/

BibTeX

@inproceedings{chhipa2024mobius,
  title     = {Möbius transform for mitigating perspective distortions in representation learning},
  author    = {Chhipa, Prakash Chandra et al.},
  booktitle = {European Conference on Computer Vision (ECCV)},
  year      = {2024},
  publisher = {Springer Nature Switzerland}
}

If this library helps your research, please cite the paper above 🙏.

License

MIT

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

mobius_mpd-0.1.5.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mobius_mpd-0.1.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mobius_mpd-0.1.5.tar.gz.

File metadata

  • Download URL: mobius_mpd-0.1.5.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for mobius_mpd-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5452e8333b0992b1b2270e59d5c6b695f210c1c9b3956a75d0ba3b4bfcb52267
MD5 1c99e6efe1c8515f506a90ec74052d21
BLAKE2b-256 3289298bc22bd4714db234d026c40bb7745347229f7f65d8b3b68205188c3ce3

See more details on using hashes here.

File details

Details for the file mobius_mpd-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mobius_mpd-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for mobius_mpd-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf03bab9c06f516f3397a391dc112aad8d63c4102320673021fe61d08cbee45
MD5 db3a4618a12964c2688723a576a2c4fb
BLAKE2b-256 569e3f7f774006d8f0ba69330d96d42a2a15fb39c9c453d6b7f815dda0ac4ad9

See more details on using hashes here.

Supported by

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