marieai / marie-ai

Integrate AI-powered Document Analysis Pipelines
MIT License
60 stars 5 forks source link

Extract error : width or height exceeds limit @ error/cache.c/OpenPixelCache/3909 #97

Closed gregbugaj closed 10 months ago

gregbugaj commented 10 months ago

Describe the bug While processing we get following error.

RROR  marie@34 Extract error : width or height exceeds limit `/tmp/tmp1blx29wi/PID_5805_12996_0_191752555_00001.tif' @ error/cache.c/OpenPixelCache/3909        [12/08/23 23:41:19]
       Traceback (most recent call last):                                                                                                                                           
         File "/opt/venv/lib/python3.10/site-packages/marie/executor/classifier/document_classifier_executor.py", line 199, in classify                                             
           metadata = self.pipeline.execute(                                                                                                                                        
         File "/opt/venv/lib/python3.10/site-packages/marie/pipe/classification_pipeline.py", line 213, in execute                                                                  
           return self.execute_frames_pipeline(                                                                                                                                     
         File "/opt/venv/lib/python3.10/site-packages/marie/pipe/classification_pipeline.py", line 137, in execute_frames_pipeline                                                  
           burst_frames(ref_id, frames, root_asset_dir)                                                                                                                             
         File "/opt/venv/lib/python3.10/site-packages/marie/pipe/components.py", line 353, in burst_frames                                                                          
           burst_tiff_frames(frames, output_dir, filename_generator=filename_generator)                                                                                             
         File "/opt/venv/lib/python3.10/site-packages/marie/utils/tiff_ops.py", line 130, in burst_tiff_frames                                                                      
           __process_burst(                                                                                                                                                         
         File "/opt/venv/lib/python3.10/site-packages/marie/utils/tiff_ops.py", line 100, in __process_burst                                                                        
           raise ident                                                                                                                                                              
         File "/opt/venv/lib/python3.10/site-packages/marie/utils/tiff_ops.py", line 98, in __process_burst                                                                         
           convert_group4(output_path_tmp, output_path)                                                                                                                             
         File "/opt/venv/lib/python3.10/site-packages/marie/utils/tiff_ops.py", line 48, in convert_group4                                                                          
           with Image(filename=src_path) as image:                                                                                                                                  
         File "/opt/venv/lib/python3.10/site-packages/wand/image.py", line 9382, in __init__                                                                                        
           self.read(filename=filename)                                                                                                                                             
         File "/opt/venv/lib/python3.10/site-packages/wand/image.py", line 10137, in read                                                                                           
           self.raise_exception()                                                                                                                                                   
         File "/opt/venv/lib/python3.10/site-packages/wand/resource.py", line 225, in raise_exception                                                                               
           raise e                                                                                                                                                                  
       wand.exceptions.ImageError: width or height exceeds limit `/tmp/tmp1blx29wi/PID_5805_12996_0_191752555_00001.tif' @ error/cache.c/OpenPixelCache/3909                        
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3526.) (r

Describe how you solve it I suspect that this is related to the setting in profile.xml

  <policy domain="resource" name="width" value="16KP"/>
  <policy domain="resource" name="height" value="16KP"/>
gregbugaj commented 10 months ago

The image was in landscape format and we are working with images of size 3000x5000px ref id: 191752555

Rithsek99 commented 10 months ago

the image ref id: 191752555 has width: 17491 pixels Height: 10687 pixels

changing both values in profile.xml to 18KP worked for me. since image size varies, I believe we should set a higher value in policy.xml to avoid running to same issue.