File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/torchcodec/transforms Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2+ # All rights reserved.
3+ #
4+ # This source code is licensed under the BSD-style license found in the
5+ # LICENSE file in the root directory of this source tree.
6+
7+ from dataclasses import dataclass
8+ from abc import ABC , abstractmethod
9+ from typing import Sequence
10+
11+
12+ @dataclass
13+ class DecoderNativeTransform (ABC ):
14+ """TODO: docstring"""
15+ @abstractmethod
16+ def make_params (self ) -> str :
17+ pass
18+
19+
20+ @dataclass
21+ class Resize (DecoderNativeTransform ):
22+ """
23+ TODO. One benefit of having parallel definitions is that it gives us a place
24+ to put documentation about what behavior we do and do not support. For
25+ example, we don't yet have fields for `interpolation` and `antialias`
26+ because we don't allow users to control those yet in decoder-native
27+ transforms.
28+ """
29+
30+ # Also note that this type is more restrictive than what TorchVision
31+ # accepts, but it accurately reflects current decoder-native transform
32+ # limitations.
33+ size : Sequence [int ]
34+
35+ def make_params (self ) -> str :
36+ return f"resize, { self .size [0 ]} , { self .size [1 ]} "
You can’t perform that action at this time.
0 commit comments