Skip to content

Commit

Permalink
fix faa7028
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Jan 4, 2022
1 parent d2dc2f7 commit c5c3b8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Sdcb.PaddleOCR/PaddleOcrClassifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public bool ShouldRotate180(Mat src)
throw new ArgumentException("src size should not be 0, wrong input picture provided?");
}

if (src.Channels() switch { 3 or 1 => true, _ => false })
if (!(src.Channels() switch { 3 or 1 => true, _ => false }))
{
throw new NotSupportedException($"{nameof(src)} channel must be 3 or 1, provided {src.Channels()}.");
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public Mat Run(Mat src)
throw new ArgumentException("src size should not be 0, wrong input picture provided?");
}

if (src.Channels() switch { 3 or 1 => true, _ => false })
if (!(src.Channels() switch { 3 or 1 => true, _ => false }))
{
throw new NotSupportedException($"{nameof(src)} channel must be 3 or 1, provided {src.Channels()}.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sdcb.PaddleOCR/PaddleOcrDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public RotatedRect[] Run(Mat src)
throw new ArgumentException("src size should not be 0, wrong input picture provided?");
}

if (src.Channels() switch { 3 or 1 => true, _ => false })
if (!(src.Channels() switch { 3 or 1 => true, _ => false }))
{
throw new NotSupportedException($"{nameof(src)} channel must be 3 or 1, provided {src.Channels()}.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sdcb.PaddleOCR/PaddleOcrRecognizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public PaddleOcrRecognizerResult Run(Mat src)
throw new ArgumentException("src size should not be 0, wrong input picture provided?");
}

if (src.Channels() switch { 3 or 1 => true, _ => false })
if (!(src.Channels() switch { 3 or 1 => true, _ => false }))
{
throw new NotSupportedException($"{nameof(src)} channel must be 3 or 1, provided {src.Channels()}.");
}
Expand Down

0 comments on commit c5c3b8b

Please sign in to comment.