Skip to content

Commit

Permalink
Fix for OF test (NVIDIA#1008)
Browse files Browse the repository at this point in the history
* fix optical flow test error

Signed-off-by: Michał Szołucha <[email protected]>
  • Loading branch information
szalpal authored Jun 25, 2019
1 parent 4b1793c commit e09512d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions dali/pipeline/operators/optical_flow/optical_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,18 @@ class OpticalFlow : public Operator<Backend> {
sequence_sizes_[i] = shape[i][0];
}

for (const auto &seq : shape) {
DALI_ENFORCE(seq[1] != frames_height_ || seq[2] != frames_width_ || seq[3] != depth_,
"Width, height and depth for Optical Flow calculation must be equal for all sequences.");
for (auto sz : sequence_sizes_) {
DALI_ENFORCE(sz >= 2, (sz == 1
? "One-frame sequence encountered. Make sure that all input sequences "
"for Optical Flow have at least 2 frames."
: "Empty sequence encountered. Make sure that all input sequences"
" for Optical Flow have at least 2 frames."));
}

for (auto sz : sequence_sizes_) {
DALI_ENFORCE(sz >= 2, (sz == 1 ? "One-frame sequence encountered. "
"Make sure that all input sequences for Optical Flow have at least 2 frames." :
"Empty sequence encountered. "
"Make sure that all input sequences for Optical Flow have at least 2 frames."));
for (const auto &seq : shape) {
DALI_ENFORCE(seq[1] == frames_height_ && seq[2] == frames_width_ && seq[3] == depth_,
"Width, height and depth for Optical Flow calculation "
"must be equal for all sequences.");
}
}

Expand Down

0 comments on commit e09512d

Please sign in to comment.