Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sequence processing to warp operator #3879

Merged
merged 27 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4fef91f
Enable sequence support and per-frame arguments for warp
stiepan Apr 26, 2022
beded02
Cpu positional input broadcasting
stiepan Apr 28, 2022
db3441b
Broadcast GPU arg
stiepan May 4, 2022
7d762ac
Sequence test util: pass sample data to arg cb
stiepan May 4, 2022
feb6ae8
Disable convolutions
stiepan May 6, 2022
eb29b70
Add a method to access mutable argument input in the workspace
stiepan May 9, 2022
c45a421
Reusing containers from expanded workspace
stiepan May 9, 2022
7781f98
Clean-up, assure setting required properties
stiepan May 9, 2022
2007416
Separate GPU broadcasting from CPU case
stiepan May 9, 2022
8175f8e
Revert "Disable convolutions"
stiepan May 9, 2022
0606cee
Cleanup
stiepan May 9, 2022
18c1419
Separate set-up of IO from filling with batch data
stiepan May 10, 2022
6387266
Small amendments to unfolding TL
stiepan May 10, 2022
e21cee5
Fix CC tests
stiepan May 10, 2022
b232273
Fix broken assertions
stiepan May 11, 2022
b3b07e5
Set type, layout and dimensionality with every iteration
stiepan May 11, 2022
3abffe5
Adjust cc tests
stiepan May 12, 2022
235b61e
Add broadcasting tests
stiepan May 12, 2022
dddbe17
TensorList broadcasting tests
stiepan May 13, 2022
6780b04
Move safeguarded batch_backend_t to type traits
stiepan May 23, 2022
088db0c
Use protected inheritance for broadcasting mixin
stiepan May 23, 2022
2a337c3
Use input_desc not ref_input_desc to unfold batch
stiepan May 23, 2022
a2d4e18
Renaming
stiepan May 23, 2022
3f4ffb8
Use memcpy order when passing expanded batch and batch
stiepan May 23, 2022
6ed1c2e
Add docs
stiepan May 23, 2022
e9c3021
Set ws order to boradcast tensorlist, remove duplicate backend_t
stiepan May 29, 2022
a89bf3e
Add a few more unfold tests and broadcasting scalar tests
stiepan May 29, 2022
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
4 changes: 2 additions & 2 deletions dali/operators/image/remap/warp_affine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DALI_SCHEMA(WarpAffine)
)code")
.NumInput(1, 2)
.NumOutput(1)
.InputLayout(0, { "HWC", "DHWC" })
.InputLayout(0, { "HWC", "FHWC", "DHWC", "FDHWC" })
.SupportVolumetric()
.AddOptionalArg<float>("matrix",
R"code(Transform matrix.
Expand All @@ -41,7 +41,7 @@ transform and it is inverted before applying the formula above.
It is equivalent to OpenCV's ``warpAffine`` operation with the ``inverse_map`` argument being
analog to the ``WARP_INVERSE_MAP`` flag.
)code",
vector<float>(), true)
vector<float>(), true, true)
.AddOptionalArg<bool>("inverse_map", "Set to ``False`` if the given transform is a "
"destination to source mapping, ``True`` otherwise.", true, false)
.AddParent("WarpAttr");
Expand Down
16 changes: 15 additions & 1 deletion dali/pipeline/data/type_traits.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
// Copyright (c) 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,6 +82,20 @@ static_assert(is_batch_container<TensorList, CPUBackend>::value, "Test failed");
static_assert(is_batch_container<TensorList, GPUBackend>::value, "Test failed");
} // namespace test


template <typename BatchType, typename T = void>
struct BatchBackend;

template <template <typename> class BatchContainer, typename Backend>
struct BatchBackend<BatchContainer<Backend>,
Comment on lines +89 to +90
Copy link
Contributor

Choose a reason for hiding this comment

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

Meh. I won't fiight for it, but I think that adding a Backend typedef to relevant types would be a little better.

std::enable_if_t<is_batch_container<BatchContainer, Backend>::value>> {
using type = Backend;
};

template <typename BatchType>
using batch_backend_t =
typename BatchBackend<std::remove_cv_t<std::remove_reference_t<BatchType>>>::type;

} // namespace dali

#endif // DALI_PIPELINE_DATA_TYPE_TRAITS_H_
Loading