Torchvision API - ColorJitter and Grayscale operators#6272
Torchvision API - ColorJitter and Grayscale operators#6272mdabek-nvidia wants to merge 10 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Marek Dabek <[email protected]>
Signed-off-by: Marek Dabek <[email protected]>
d236be4 to
1a74665
Compare
|
!build |
|
@greptileai - please review |
|
CI MESSAGE: [46735031]: BUILD STARTED |
Greptile SummaryThis PR adds Key points:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["User input\n(PIL.Image / torch.Tensor)"] --> B["adjust_input decorator\ntransform_input()"]
B --> C{"Input type"}
C -->|"PIL.Image"| D["ndd.Tensor\nlayout=HWC"]
C -->|"torch.Tensor 3D"| E["ndd.Tensor\nlayout=CHW"]
C -->|"torch.Tensor >3D"| F["ndd.Batch\nlayout=CHW"]
D & E & F --> G{"Operator"}
G -->|"ColorJitter"| H["VerificationBCS + VerificationHue\n(in super().__init__)"]
H --> I["_create_param(brightness/contrast/saturation)\n→ list[float, float]"]
I --> J["hue scalar → (-hue, hue) tuple"]
J --> K["_kernel: _get_BCSH\nsamples random factors"]
K --> L["fn.color_twist()\nbright/contrast/sat/hue"]
G -->|"Grayscale"| M["VerificationGSOutputChannels\n(in super().__init__)"]
M --> N["preprocess_data:\nget_HWC_from_layout_pipeline\n→ (h, w, c, tensor)"]
N --> O{"num_output_channels × c"}
O -->|"1×3: RGB→Gray"| P["fn.color_space_conversion\nRGB→GRAY"]
O -->|"1×1: no-op"| Q["pass"]
O -->|"3×1: replicate"| R["fn.cat × 3 on C axis"]
O -->|"3×3: desaturate"| S["fn.hsv saturation=0"]
L & P & Q & R & S --> T["output ndd.Tensor/Batch"]
T --> U["adjust_output\n→ PIL.Image or torch.Tensor"]
|
dali/python/nvidia/dali/experimental/torchvision/v2/operator.py
Outdated
Show resolved
Hide resolved
|
CI MESSAGE: [46735031]: BUILD PASSED |
ac68f8c to
994315b
Compare
|
!build |
|
CI MESSAGE: [46765427]: BUILD STARTED |
|
CI MESSAGE: [46765427]: BUILD FAILED |
Signed-off-by: Marek Dabek <[email protected]>
Signed-off-by: Marek Dabek <[email protected]> Co-authored-by: Kamil Tokarski <[email protected]>
Signed-off-by: Marek Dabek <[email protected]>
Signed-off-by: Marek Dabek <[email protected]>
Signed-off-by: Marek Dabek <[email protected]>
Signed-off-by: Marek Dabek <[email protected]>
Signed-off-by: Marek Dabek <[email protected]>
994315b to
6a0038d
Compare
|
@greptileai please re-review |
|
!build |
|
CI MESSAGE: [46875703]: BUILD STARTED |
Signed-of-by: Marek Dabek <[email protected]>
544b424 to
f53d4ec
Compare
|
CI MESSAGE: [46875703]: BUILD PASSED |
Category:
New feature
Description:
Implementation of Torchvison OO API operators:
Implementation of Torchvision functional operators:
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A