Conversation
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com> Co-authored-by: Kamil Tokarski <kamiltokarski04@gmail.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-of-by: Marek Dabek <mdabek@nvidia.com>
6056187 to
6ddc68a
Compare
5521fe5 to
ef0bf89
Compare
|
@greptileai please review |
|
!build |
|
CI MESSAGE: [46880386]: BUILD STARTED |
Greptile SummaryThis PR adds a Confidence Score: 5/5Safe to merge; all prior blocking issues are resolved and remaining findings are minor test housekeeping. All P0/P1 issues from previous review rounds have been addressed. The only remaining findings are P2 test-file style concerns (wrong comment shape, stale citation tokens, commented-out dead code). These do not affect runtime correctness or the operator contract. dali/test/python/torchvision/test_tv_gaussian_blur.py — minor comment and dead-code cleanup needed. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Input["Input (PIL / torch.Tensor)"]
AdjustInput["adjust_input decorator"]
VerifyArgs["GaussianBlur.verify_args"]
subgraph PipelineMode["Pipeline Mode"]
SigmaRange1{"sigma range?"}
RandomUniform1["fn.random.uniform(range=sigma)"]
ScalarSigma1["sigma = sigma[0]"]
FnGaussianBlur["fn.gaussian_blur"]
end
subgraph DynamicMode["Dynamic Mode"]
SigmaRange2{"sigma range?"}
RandomUniform2["ndd.random.uniform(range=sigma)"]
ScalarSigma2["sigma = sigma[0]"]
NddGaussianBlur["ndd.gaussian_blur"]
end
Output["Output (PIL / torch.Tensor)"]
Input --> AdjustInput --> VerifyArgs
VerifyArgs --> PipelineMode
VerifyArgs --> DynamicMode
SigmaRange1 -- yes --> RandomUniform1 --> FnGaussianBlur
SigmaRange1 -- no --> ScalarSigma1 --> FnGaussianBlur
SigmaRange2 -- yes --> RandomUniform2 --> NddGaussianBlur
SigmaRange2 -- no --> ScalarSigma2 --> NddGaussianBlur
FnGaussianBlur --> Output
NddGaussianBlur --> Output
Reviews (12): Last reviewed commit: "Merge branch 'main' into torchvision_gau..." | Re-trigger Greptile |
|
CI MESSAGE: [46880386]: BUILD PASSED |
afc4838 to
455f51e
Compare
|
@greptileai please review |
|
!build |
|
CI MESSAGE: [46954308]: BUILD STARTED |
|
CI MESSAGE: [46954308]: BUILD PASSED |
ea898cb to
abdd2e6
Compare
|
CI MESSAGE: [47327945]: BUILD PASSED |
|
CI MESSAGE: [47329835]: BUILD PASSED |
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Center crop operators implementation Signed-off-by: Marek Dabek <mdabek@nvidia.com> Co-authored-by: Kamil Tokarski <kamiltokarski04@gmail.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
26edf14 to
946223a
Compare
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
08fd716 to
b940dc6
Compare
|
|
||
| if not isinstance(kernel_size, (int, Sequence)): | ||
| raise ValueError( | ||
| f" Kernel size should be an int or a sequenece of ints, got {kernel_size}" |
There was a problem hiding this comment.
| f" Kernel size should be an int or a sequenece of ints, got {kernel_size}" | |
| f"Kernel size should be an int or a sequence of ints, got {kernel_size}" |
|
|
||
| if isinstance(kernel_size, Sequence) and any(not isinstance(v, int) for v in kernel_size): | ||
| raise ValueError( | ||
| f" Kernel size should be an int or a sequenece of ints, got {kernel_size}" |
There was a problem hiding this comment.
| f" Kernel size should be an int or a sequenece of ints, got {kernel_size}" | |
| f"Kernel size should be an int or a sequence of ints, got {kernel_size}" |
| kernel_size: int | Sequence[int], | ||
| sigma: int | float | Sequence[float] = (0.1, 2.0), | ||
| device: Literal["cpu", "gpu"] = "cpu", | ||
| ) -> Image.Image | torch.Tensor: |
There was a problem hiding this comment.
should these types annotations match the actual function body (ndd typesor what happens after annotating withadjust_input`?
There was a problem hiding this comment.
Answering both comments, the one I am responding to and to @rostan-t 's one .
The logic for annotations (here and in every other functional API call) is that it is additional information for users to what is being supported by the API, especially that every input is converted to ndd.Tensor or ndd.Batch by the adjust_input operator.
| dali_blur = Compose([GaussianBlur(kernel_size=kernel_size, sigma=sigma)]) | ||
| _ = dali_blur(tens) | ||
|
|
||
| """ Both do not raise ValueError |
There was a problem hiding this comment.
why do we have this commented out?
There was a problem hiding this comment.
The expectation was that invalid kernel/sigma will cause a ValueError exception, but it did not even in the original code. I am keeping it as a documentation of an oddity.
…VIDIA#6262) * Improve call stack depth handling for error tracebacks in dynamic mode * Rework exception_tester to automatically infer expected line and message --------- Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
Add uniform_sample option to VideoReaderDecoder
Adds a `uniform_sample` argument that samples exactly `sequence_length`
frames uniformly across the full video (or ROI) using linspace with
std::round rounding. Each video produces one sample per epoch; `stride`
and `step` are ignored (with a DALI_WARN if `pad_mode` is also set).
`sequence_length` must be >= 1 when `uniform_sample=True`.
To avoid a per-sample heap allocation, VideoSampleDesc::frame_idxs_
changes from std::vector<int> to span<const int>. Owned storage moves
to all_frame_idxs_ (vector<vector<int>>) in the loader, which is
populated once in PrepareMetadataImpl and stable for the loader's
lifetime. The copy in ReadSample becomes a cheap 16-byte span copy.
all_frame_idxs_ is declared before samples_ so its lifetime encloses
the spans, preventing dangling references on destruction.
New tests:
- test_uniform_sample_basic: verifies frame indices match expected linspace
- test_uniform_sample_file_list_roi: ROI with non-zero start_frame via file_list
- test_uniform_sample_sequence_length_zero_raises: sequence_length=0 raises
- test_uniform_sample_stride_step_ignored: stride/step have no effect
Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
- cudaDeviceSynchronize returns cudaErrorStreamCaptureUnsupported when any stream on the device is being captured. DLTensorGraveyard now puts pending deletions back in the queue and retries after a short wait instead of propagating the error. Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
* Torchvision ColorJitter and Grayscale implementations Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
9a2fbb5 to
73b0d56
Compare
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
73b0d56 to
52c9006
Compare
|
!build |
|
CI MESSAGE: [47536002]: BUILD STARTED |
|
CI MESSAGE: [47536002]: BUILD PASSED |
Category:
New feature
Description:
Implementation of Torchvision's GaussianBlur operator
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