dhlab-epfl / dhSegment

Generic framework for historical document processing
https://dhlab-epfl.github.com/dhSegment
GNU General Public License v3.0
373 stars 116 forks source link

No box found : Is dhSegment fit for my problem ? #47

Closed jlhervy closed 5 years ago

jlhervy commented 5 years ago

Hello,

I would like to detect defects introduced on documents by faulty scanners, in particular vertical lines.

So I have a dataset consisting of the same document, with one random line added to each document.

As I presumed the model would work better with detecting horizontal lines, I flipped all the images in my dataset.

All my images are annotated in the same way as the demo dataset. Here you can see two images and their label from my dataset :

img-1721 img-1721 img-1742 img-1742

I quickly trained the model on 300 training samples, and the loss does seem do decrease (although I haven't fully grasped all the logs, and the way sacred works).

However when I apply the model on the test set, I get "No box found in demo/pages/test_a1/images/img-xxx.png" for all of the images...

So I wonder if dhSegment can work for this task of finding thin lines. I used the basic demo config, and did not change much (except n_epoch that I set to 1, but even then It seemed to get through 10 iterations of the dataset).

I am on Ubuntu 18.04 and train with a GP100.

If dhSegment isn't fit for this task, could you suggest me some ways I could achieve this detection ? I am a bit stuck at the moment.

Thank you a lot.

jlhervy commented 5 years ago

Actually I didn't modify the demo script, and when I plot the probability map, I can see that there is some detection of the horizontal lines : ImageWindow_screenshot_12 09 2019

So I will try to play with the post-processing functions that you provide, in order to get the result I would like.

I am still open to suggestions as I feel that this is like big artillery for such a basic task. I am sure there would be a simpler way. However I have made the lines fat and noticeable for the sake of obtaining a first result, but ideally I would like to detect much thinner lines, sometimes not continuous, and also multiple ones.

Thank you.