Hey, I haven't been able to use the detect function with any sort of list of images, I have tried with a list of numpy arrays, a list of bytes (PNG encoding), with and without the "reformat" argument, but it keeps failing when trying to access the image list as a numpy array (search for the "shape" attribute exist in a single numpy array).
reader = easyocr.Reader(["ar","fa","ur","ug","en"],
detect_network="dbnet18", #'craft'
recognizer=False,
quantize=True)
...
reader.detect(images_bytes_list,bbox_min_size=7,reformat=False)
OR
def img_decode(content: bytes):
np_arr = np.frombuffer(content, dtype=np.uint8)
return cv2.imdecode(np_arr, cv2.IMREAD_UNCHANGED)
images_np_list =[img_decode(img) for img in images_bytes_list]
reader.detect(images_bytes_list,bbox_min_size=7,reformat=False)
each element in the list is of shape (1024, 576, 3).
the error massage is :
File "<string>", line 2, in <module>
File "/home/ubuntu/venv-ai/lib/python3.9/site-packages/easyocr/easyocr.py", line 321, in detect
text_box_list = self.get_textbox(self.detector,
File "/home/ubuntu/venv-ai/lib/python3.9/site-packages/easyocr/detection_db.py", line 207, in get_textbox
_, polys_list = test_net(image,
File "/home/ubuntu/venv-ai/lib/python3.9/site-packages/easyocr/detection_db.py", line 74, in test_net
images, original_shapes = zip(*[detector.resize_image(img, canvas_size) for img in image_arrs])
File "/home/ubuntu/venv-ai/lib/python3.9/site-packages/easyocr/detection_db.py", line 74, in <listcomp>
images, original_shapes = zip(*[detector.resize_image(img, canvas_size) for img in image_arrs])
File "/home/ubuntu/venv-ai/lib/python3.9/site-packages/easyocr/DBNet/DBNet.py", line 254, in resize_image
height, width, _ = img.shape
AttributeError: 'list' object has no attribute 'shape'```
Hey, I haven't been able to use the detect function with any sort of list of images, I have tried with a list of numpy arrays, a list of bytes (PNG encoding), with and without the "reformat" argument, but it keeps failing when trying to access the image list as a numpy array (search for the "shape" attribute exist in a single numpy array).
each element in the list is of shape (1024, 576, 3).
the error massage is :