Skip to content

Saeed-Biabani/Document-Scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Document Scanner 📑

U-Net Like Pretrained Model For Scene Document Detection (pytorch, Semantic Segmentation)

Quick Links

Dependencies

  • Install Dependencies $ pip install -r requirements.txt
  • Download model weights Here, place it in Structure/

Usage:

  scanner = Scanner("Structure/Scanner-Detector.pth", config_)

Load model.

  org = cv2.imread(fname)
  org_gray = cv2.cvtColor(org, cv2.COLOR_RGB2GRAY)
  org_resize = cv2.resize(org_gray, (256, 256), interpolation = cv2.INTER_AREA)

Read image in gray scale and resize it to 256*256.

  mask = scanner.ScanView(org_resize)

Detect document area.

  paper, approx = ExtractPaper(org_gray, mask)
  org = DrawBox(org, approx)

Extract document and draw bounding box on original image.

  paper = EnhacePaper(paper)

Enhance extracted document.

Examples

🛡️ License

Project is distributed under MIT License

About

U-Net Like Pretrained Model For Scene Document Detection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages