Coder Social home page Coder Social logo

Comments (6)

ajgallego avatar ajgallego commented on July 28, 2024

The dataset path arrangement is defined at the function "load_dataset_folds", which is in the "train.py" file.

When running this code you have to set the -path parameter with the folder that contains the datasets and use -db to set the dataset name.

I hope this helps

from document-image-binarization.

Xiaozeeze avatar Xiaozeeze commented on July 28, 2024

Is that what you mean?
path/db/dbp

I define path as datasets, and db in "phi" is "PHI/train/phi_GR", so my directory is "datasets/PHI/train/phi_GR", right?
And in this directory, there are two subfolders with the suffix GR and GT, which contain the original image and the fine standard respectively.

Am I doing the right thing?

from document-image-binarization.

Xiaozeeze avatar Xiaozeeze commented on July 28, 2024

I did this but made a mistake.

Traceback (most recent call last):
File "train.py", line 305, in
main()
File "train.py", line 252, in main
x_test, y_test = utilDataGenerator.generate_chunks(array_test_files, x_sufix, y_sufix, args.window, args.window)
File "/public/home///document-image-binarization-master/binarize/utilDataGenerator.py", line 74, in generate_chunks
x_data = x_data.reshape(x_data.shape[0], x_data.shape[1], x_data.shape[2], 1)
IndexError: tuple index out of range

After that, I deleted two subfolders with the suffix GR and GT, and this error also occurred, so I think it maybe a path error.

from document-image-binarization.

ajgallego avatar ajgallego commented on July 28, 2024

Yes, that is right. The path should be:
datasets/PHI/train/phi_GR
datasets/PHI/train/phi_GT
datasets/PHI/test/phi_GR
datasets/PHI/test/phi_GT

And you should run something like this:
python -u train.py -path datasets -db phi ...rest of parameters...

The extensions of the images should be ".png"

You may also add some prints in the code to debug what is happening.

from document-image-binarization.

Xiaozeeze avatar Xiaozeeze commented on July 28, 2024

Thanks! My problem has been solved!Also, I trained with my own data set, and it worked well.

Finally,can you tell me about dbp, if you like?

from document-image-binarization.

ajgallego avatar ajgallego commented on July 28, 2024

"-dbp" parameter is only used for the datasets Dibco and Palm.
It allows you to indicate the fold number of Dibco and the GT number of Palm.
In Dibco there are datasets for several years skipped from 2009 to 2016, so you can enter dbp values from 0 to 6 to select the year you want.
On Palm there are 2 annotators, so with dbp you can enter 0 to select the first annotator and 1 for the second.

from document-image-binarization.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.