Skip to content

Commit

Permalink
$ git ls-files -z | xargs -0 sed -i 's/Size.Zero/default/'
Browse files Browse the repository at this point in the history
  • Loading branch information
n0099 committed Jan 3, 2024
1 parent f07aec7 commit 338adac
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/test.linq
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using PaddleOcrAll all = new(model.DetectionDirectory, model.ClassifierDirectory
//var predictor = PaddleConfig.FromModelDir(model.DetectionDirectory);
//predictor.Dump();

using Mat scaled = src.Resize(Size.Zero, 1, 1);
using Mat scaled = src.Resize(default, 1, 1);
var sw = Stopwatch.StartNew();
PaddleOcrResult result = all.Run(scaled);
sw.ElapsedMilliseconds.Dump("elapsed");
Expand Down
2 changes: 1 addition & 1 deletion docs/ocr.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public class OcrController : Controller
stream.CopyTo(ms);
using Mat src = Cv2.ImDecode(ms.ToArray(), ImreadModes.Color);
double scale = 1;
using Mat scaled = src.Resize(Size.Zero, scale, scale);
using Mat scaled = src.Resize(default, scale, scale);

Stopwatch sw = Stopwatch.StartNew();
string textResult = (await _ocr.Run(scaled)).Text;
Expand Down
2 changes: 1 addition & 1 deletion src/Sdcb.PaddleDetection/Preprocessers/ResizeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override void Run(Mat src, ImageProcessContext data)
Size size = src.Size();
data.NetShape = new Size2f(size.Width * scale.X, size.Height * scale.Y);

Cv2.Resize(src, src, Size.Zero, scale.X, scale.Y, Interpolation);
Cv2.Resize(src, src, default, scale.X, scale.Y, Interpolation);
data.Shape = src.Size();
data.ScaleFactor = scale;
}
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 @@ -257,7 +257,7 @@ private static Mat MatResize(Mat src, int? maxSize)
double scaleRate = 1.0 * maxSize.Value / longEdge;

return scaleRate < 1.0 ?
src.Resize(Size.Zero, scaleRate, scaleRate) :
src.Resize(default, scaleRate, scaleRate) :
src.Clone();
}

Expand Down

0 comments on commit 338adac

Please sign in to comment.