Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.52 KB

rotation-detection.md

File metadata and controls

29 lines (23 loc) · 1.52 KB

Sdcb.RotationDetector usage

Sdcb.RotationDetector is part of PaddleClas, it's based on PULC Classification Model of Text Image Orientation

NuGet Packages:

Rotation Detection packages (part of PaddleCls) 🔄

NuGet Package 💼 Version 📌 Description 📚
Sdcb.RotationDetector NuGet RotationDetector library(based on Sdcb.PaddleInference) ⚙️

Usage:

  1. Install NuGet Packages:

    Sdcb.PaddleInference.runtime.win64.mkl
    Sdcb.RotationDetector
    OpenCvSharp4.runtime.win
    
  2. Using following C# code to get result:

    using PaddleRotationDetector detector = new PaddleRotationDetector(RotationDetectionModel.EmbeddedDefault);
    using Mat src = Cv2.ImRead(@"C:\your-local-file-here.jpg");
    RotationResult r = detector.Run(src);
    Console.WriteLine(r.Rotation); // _0, _90, _180, _270
    
    // Restore to non-rotated:
    // r.RestoreRotationInPlace(src);