Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cleaning printed text using Denoising Autoencoder based on UNet architecture in PyTorch

NotificationsYou must be signed in to change notification settings

n0obcoder/UNet-based-Denoising-Autoencoder-In-PyTorch

Repository files navigation

Cleaning printed text using Denoising Autoencoder based on UNet architecture in PyTorch

Acknowledgement

The UNet architecture used here is borrowed fromhttps://github.com/jvanvugt/pytorch-unet.The only modification made in the UNet architecture mentioned in the above link is the addition of dropout layers.

Requirements

  • torch >= 0.4
  • torchvision >= 0.2.2
  • opencv-python
  • numpy >= 1.7.3
  • matplotlib
  • tqdm

Generating Synthetic Data

Set the number of total synthetic images to be generatednum_synthetic_imgs and set the percentage of training datatrain_percentage inconfig.pyThen run

python generate_synthetic_dataset.py

It will generate the synthetic data in a directory nameddata (can be changed in the config.py) in the root dirctory.

Training

Set the desired values oflr,epochs andbatch_size inconfig.py

Start Training

Inconfig.py,

  • setresume to False
python train.py

Resume Training

Inconfig.py,

  • setresume to True and
  • setckpt to the path of the model to be loaded, i.e. ckpt = 'model02.pth'
python train.py

Losses

The model was trained for 12 epochs for the configuration mentioned inconfig.pyloss after 12 epochs

Testing

Inconfig.py,

  • setckpt to the path of the model to be loaded, i.e. ckpt = 'model02.pth'
  • settest_dir to the path that contains the noisy images that you need to denoise ('data/val/noisy' by default)
  • settest_bs to the desired batch size for the test set (1 by default)
python test.py

Once the testing is done, the results will be saved in a directory namedresults

Results {Noisy (Top) and Denoised (Bottom) Image Pairs)}

*
res01.png
*
res02.png
*
res03.png
*
res04.png
*
res05.png

About

Cleaning printed text using Denoising Autoencoder based on UNet architecture in PyTorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp