Link to article DocRes: A Generalist Model Toward Unifying Document Image Restoration Tasks.
Link to original repository DocRes
- Clone repository
git clone https://github.com/AiLoveX/DocRes.git
- Put MBD model weights mbd.pkl to
./data/MBD/checkpoint/
!You will need to create folders! - Put DocRes model weights docres.pkl to
./checkpoints/
!You will need to create folders! - Launch Docker Desktop
- Run
create_docker.bat
and wait about 5-15 min - Run
run_docker.bat
for default parameters - Check the result in "docker_output" folder
If you want to use your own images
- Follow the first 5 steps of the Instructions
- Place your images in
./input/
- Run
create_docker.bat
and wait about 5-15 min - At the command line, forward to your folder and enter
run_docker.bat ./input/your_image task false
first argument
: the path of input document imagesecond argument
:task that need to be executed, it must be one of dewarping, deshadowing, appearance, deblurring, binarization, or end2endthird argument
: it is a choice whether to use pixel-by-pixel image comparison or not. The default is set totrue
, with the test for default parameters. If you don't need it, enterfalse
.
If you want to compare your image with the received one, then enter
run_docker.bat ./input/your_image task true ./folder/your_image1 ./folder/your_image2
fourth argument
: path to the first image we want to compare pixel by pixelfifth argument
: path to the second image we want to compare
In Docker, all output goes to the ./restorted/
folder. If you want to compare a picture with a picture that is displayed in it, then their names are usually formed as your_image_task
and the format of the input image.