Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The data link is broken #21

Open
zimo99 opened this issue Sep 19, 2021 · 3 comments
Open

The data link is broken #21

zimo99 opened this issue Sep 19, 2021 · 3 comments

Comments

@zimo99
Copy link

zimo99 commented Sep 19, 2021

微信图片_20210919173957

We can't find the original data, so we don't know their original appearance and filename。 Therefore, we don't know how to rename and how to arrange the path.

@Bartzi
Copy link
Owner

Bartzi commented Sep 20, 2021

Hi,

that's a pity. It seems the repository does not exist anymore. It was a nice place to get the data. So now, you'll need to gather the data from somewhere else. If you find links and folder structures, I might be able to help you with renaming and arranging

@Bartzi
Copy link
Owner

Bartzi commented Oct 6, 2021

Alright, so you got the data that is great!

Now, you'll just need to prepare the npz files. Preparing them is actually quite simple.
You'll need to create 4 numpy arrays:

  1. an array that you call num_words. This array has only one element and is of type int. The element should be the max. number of characters per image (it is called num_words because the network thinks that each character is a word). In our experiments we always set this to 23.
  2. an array with one element of type type int. You call this num_chars. Here the value of the element should be 1 because we have num_words words of one character during training.
  3. an array called file_name of type string. Here, you concatenate the relative path to all image files that you want to use for evaluation.
  4. another array of strings called text. This time with the word in each image. Make sure that the indices align. So the word at index 1 in the array text should correspond to the correct image file at index 1 in the array file_name.

Once you have all of these arrays, you just need to save them (let me show you an example):

# create the arrays
data = {
  "num_words": ....,
  "num_chars": ....,
  "file_name": ....,
  "text": ...
}

# now we save everything
 with open("destination.npz", 'wb') as f:
        numpy.savez_compressed(f, **data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants