Comments (3)
Hi, you can now choose your gpu by
reader = easyocr.Reader(['en'], gpu = 'your choice here')
from easyocr.
OK, will add this feature soon. In the mean time, you can use cpu by using
reader = easyocr.Reader(['en'], gpu = False)
from easyocr.
Hi tried this but still had issues:
/katakana/notebooks/vision/ocr_hybrid.py in easy_ocr_no_table(img, device)
69 img = prep_img_for_easyocr(img)
70 img = remove_table_from_scan(img)
---> 71 result = run_easy_ocr(img, device)
72 return result
73
~/katakana/notebooks/vision/ocr_hybrid.py in run_easy_ocr(img, device)
60 if easyocr_reader is None:
61 load_easyocr_reader(device) # to prevent slow import
---> 62 result = easyocr_reader.readtext(
63 img, link_threshold=0.99, text_threshold=0.7, add_margin=0.02
64 )
~/.local/lib/python3.8/site-packages/easyocr/easyocr.py in readtext(self, image, decoder, beamWidth, batch_size, workers, allowlist, blocklist, detail, rotation_info, paragraph, min_size, contrast_ths, adjust_contrast, filter_ths, text_threshold, low_text, link_threshold, canvas_size, mag_ratio, slope_ths, ycenter_ths, height_ths, width_ths, y_ths, x_ths, add_margin, output_format)
383 img, img_cv_grey = reformat_input(image)
384
--> 385 horizontal_list, free_list = self.detect(img, min_size, text_threshold,\
386 low_text, link_threshold,\
387 canvas_size, mag_ratio,\
~/.local/lib/python3.8/site-packages/easyocr/easyocr.py in detect(self, img, min_size, text_threshold, low_text, link_threshold, canvas_size, mag_ratio, slope_ths, ycenter_ths, height_ths, width_ths, add_margin, reformat, optimal_num_chars)
273 img, img_cv_grey = reformat_input(img)
274
--> 275 text_box_list = get_textbox(self.detector, img, canvas_size, mag_ratio,
276 text_threshold, link_threshold, low_text,
277 False, self.device, optimal_num_chars)
~/.local/lib/python3.8/site-packages/easyocr/detection.py in get_textbox(detector, image, canvas_size, mag_ratio, text_threshold, link_threshold, low_text, poly, device, optimal_num_chars)
92 result = []
93 estimate_num_chars = optimal_num_chars is not None
---> 94 bboxes_list, polys_list = test_net(canvas_size, mag_ratio, detector,
95 image, text_threshold,
96 link_threshold, low_text, poly,
~/.local/lib/python3.8/site-packages/easyocr/detection.py in test_net(canvas_size, mag_ratio, net, image, text_threshold, link_threshold, low_text, poly, device, estimate_num_chars)
43 # forward pass
44 with torch.no_grad():
---> 45 y, feature = net(x)
46
47 boxes_list, polys_list = [], []
/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
--> 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),
/usr/local/lib/python3.8/dist-packages/torch/nn/parallel/data_parallel.py in forward(self, *inputs, **kwargs)
151 for t in chain(self.module.parameters(), self.module.buffers()):
152 if t.device != self.src_device_obj:
--> 153 raise RuntimeError("module must have its parameters and buffers "
154 "on device {} (device_ids[0]) but found one of "
155 "them on device: {}".format(self.src_device_obj, t.device))
RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cuda:3
from easyocr.
Related Issues (20)
- Angle of the text
- original dataset
- How can I reliably find numbers? HOT 1
- Request for Updated Pre-trained Models and Guidance on Fine-tuning EasyOCR
- "detector=False" exception
- the reconition model can't recognise space?
- Failed to recognize clearly written Chinese characters
- Support for rocm amd gpu card HOT 1
- ValueError: Usecols do not match columns, columns expected but not found: ['Col3', 'Col1'].
- EasyOCR is taking ~8 seconds for initialization
- OCR boxes: is there a way to sort boxes left to right HOT 1
- Can't recognize an image with only '0' HOT 1
- Missing Confidence Score in Paragraph Mode HOT 2
- why i skip the first step, and train my own dataset without pretrained model is error? Does the first step have to be done?
- new version of python-bidi doesn't have `algorithm` module HOT 3
- check my code please, it doesnt recognise all letters HOT 2
- IndexError: index 54 is out of bounds for axis 0 with size 39 HOT 1
- Is this project abandoned? HOT 1
- pyinstaller error HOT 2
- How do I control maximum and mimimum font size to be read? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyocr.