`apply!` and `Buffered` projective transforms fail on `BoundingBox`/`Polygon` items

Aperta
#121 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Ambito
backend

Direzione di ricerca

Start by locating the apply! dispatch for ProjectiveTransform and the project/project! methods it calls; the report identifies the missing forwarding for ItemWrapper values such as BoundingBox and Polygon. Compare that path with apply(::Transform, ::ItemWrapper) and check the tests covering buffered and in-place transforms. Done means the reported examples work for wrapped items while the existing unbuffered behavior remains covered.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Applying a buffered projective transform to items that include an ItemWrapper (BoundingBox, Polygon) throws a MethodError, while the unbuffered apply works:

using DataAugmentation, StaticArrays

img = Image(rand(64, 64))
bbox = BoundingBox([SVector(10.0, 10.0), SVector(40.0, 50.0)], (64, 64))
tfm = ScaleRatio((0.5, 0.5))

apply(tfm, (img, bbox))                # works
apply(Buffered(tfm), (img, bbox))      # errors
apply!(apply(tfm, bbox), tfm, bbox)    # errors
ERROR: MethodError: no method matching project(::CoordinateTransformations.LinearMap{SMatrix{2, 2, Float32, 4}}, ::BoundingBox{2, Float64, SVector{2, Float64}}, ::Bounds{2})

apply(::Transform, ::ItemWrapper) unwraps the item before transforming it, but the in-place path apply!(buf, ::ProjectiveTransform, item) → project! → project is called on the wrapper itself, and neither project nor project! has methods for ItemWrappers. Forwarding them to the wrapped item and rewrapping the result should fix it.

Seen with DataAugmentation v0.3.5 on Julia 1.13.

🧔‍♂️🤖 Assisted by AI

Lingua principale
Julia
Stelle
47
Fork
18
Merge medio
33m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FluxML/DataAugmentation.jl

Tutte le issue di FluxML/DataAugmentation.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.