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

Batch Prediction #157

Open
Sayyam-Jain opened this issue Dec 5, 2019 · 1 comment
Open

Batch Prediction #157

Sayyam-Jain opened this issue Dec 5, 2019 · 1 comment

Comments

@Sayyam-Jain
Copy link

Sayyam-Jain commented Dec 5, 2019

Hi. Thank you for the nice work. I noticed that during prediction, each image is loaded and OCR is predicted. Can you please tell me how to predict on a batch of images simultaneously in order to increase GPU efficiency and save time. Thanks

elif parameters.phase == 'predict':
            for line in sys.stdin:
                filename = line.rstrip()
                try:
                    with open(filename, 'rb') as img_file:
                        img_file_data = img_file.read()
                except IOError:
                    logging.error('Result: error while opening file %s.', filename)
                    continue
                text, probability = model.predict(img_file_data)
                logging.info('Result: OK. %s %s', '{:.2f}'.format(probability), text)
@thewhiteflower110
Copy link

For testing I found it -> model/model.py line no. 85
For predict, you may improvise the predict method on line no. 288 of model.py

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