Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
36ae12e
Copy paste prototype.datapoints and prototype.transforms out of proto…
NicolasHug Feb 15, 2023
a144417
make test/test_prototype_transforms_consistency.py use torchvision area
NicolasHug Feb 15, 2023
46086b8
Migrate more tests
NicolasHug Feb 15, 2023
73d0e0f
Updated imports
vfdev-5 Feb 15, 2023
1958bcd
Merge branch 'migration_transforms_v2' of github.com:pytorch/vision i…
NicolasHug Feb 15, 2023
6fd6614
Update geometry files
NicolasHug Feb 15, 2023
fd751c6
SNEAKY
NicolasHug Feb 15, 2023
2a41357
Some updates, might have broken more stuff
NicolasHug Feb 15, 2023
22c7499
Missed some
NicolasHug Feb 15, 2023
55b3772
Fixed functional tests
vfdev-5 Feb 15, 2023
ad87f5b
some removals
NicolasHug Feb 15, 2023
ced6992
Fixed issue with temporal test, test_batched_vs_single
vfdev-5 Feb 15, 2023
b5a67ab
Merge branch 'migration_transforms_v2' of github.com:pytorch/vision i…
NicolasHug Feb 15, 2023
8511b6f
All test_prototype_transforms* should be passing now
NicolasHug Feb 15, 2023
481b939
Merge branch 'main' into migration_transforms_v2
pmeier Feb 15, 2023
f49beb3
cherry-pick d010e82fec10422f79c69564de7ff2721d93d278
pmeier Feb 15, 2023
d8ec4f1
migrate video utility transforms back to prototype
pmeier Feb 15, 2023
99590c0
migrate FixedSizeCrop back to prototype
pmeier Feb 15, 2023
8f49358
remove all mentions of Label and OneHotLabel from transforms.v2
pmeier Feb 15, 2023
ec805da
Fixed code formatting and failing tests
vfdev-5 Feb 15, 2023
86537d7
fix tests
pmeier Feb 15, 2023
3691c8d
Merge branch 'migration_transforms_v2' of https://github.com/pytorch/…
pmeier Feb 15, 2023
1f86853
remove dead code from prototype
pmeier Feb 16, 2023
fe00914
lint and prototype datasets
pmeier Feb 16, 2023
64ecaf1
fix dataset wrapper tests
pmeier Feb 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions test/test_prototype_transforms_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import pytest

import torch
import torchvision.transforms.v2 as prototype_transforms
from prototype_common_utils import (
ArgsKwargs,
assert_close,
Expand All @@ -24,14 +25,13 @@
make_segmentation_mask,
)
from torch import nn
from torchvision import transforms as legacy_transforms
from torchvision import datapoints, transforms as legacy_transforms
from torchvision._utils import sequence_to_str
from torchvision import datapoints
import torchvision.transforms.v2 as prototype_transforms
from torchvision.prototype import transforms as actual_prototype_transforms
from torchvision.transforms import functional as legacy_F
from torchvision.transforms.v2 import functional as prototype_F
from torchvision.transforms.v2.functional import to_image_pil
from torchvision.transforms.v2.utils import query_spatial_size
from torchvision.transforms import functional as legacy_F

DEFAULT_MAKE_IMAGES_KWARGS = dict(color_spaces=["RGB"], extra_dims=[(4,)])

Expand Down Expand Up @@ -1089,12 +1089,18 @@ def make_datapoints(self, with_mask=True):
"t_ref, t, data_kwargs",
[
(det_transforms.RandomHorizontalFlip(p=1.0), prototype_transforms.RandomHorizontalFlip(p=1.0), {}),
(det_transforms.RandomIoUCrop(), prototype_transforms.RandomIoUCrop(), {"with_mask": False}),
# FIXME: make
Copy link
Contributor

@vfdev-5 vfdev-5 Feb 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmeier what's broken here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing the Label and OneHotLabel classes, RandomIoUCrop no longer removes labels since it doesn't have a notion of them. To resolve this, we need to follow my suggestion in the comment and use a composed transform with RandomIoUCrop and the new SanitizeBoundingBoxes that @NicolasHug implemented.

# prototype_transforms.Compose([
# prototype_transforms.RandomIoUCrop(),
# prototype_transforms.SanitizeBoundingBoxes()
# ])
# work
# (det_transforms.RandomIoUCrop(), prototype_transforms.RandomIoUCrop(), {"with_mask": False}),
(det_transforms.RandomZoomOut(), prototype_transforms.RandomZoomOut(), {"with_mask": False}),
(det_transforms.ScaleJitter((1024, 1024)), prototype_transforms.ScaleJitter((1024, 1024)), {}),
(
det_transforms.FixedSizeCrop((1024, 1024), fill=0),
prototype_transforms.FixedSizeCrop((1024, 1024), fill=0),
actual_prototype_transforms.FixedSizeCrop((1024, 1024), fill=0),
{},
),
(
Expand Down