marieai / marie-ai

Integrate AI-powered Document Analysis Pipelines
MIT License
57 stars 3 forks source link

ValueError: could not broadcast input array from shape #89

Open gregbugaj opened 10 months ago

gregbugaj commented 10 months ago

Negative region coordinates cause broadcast error.


ERROR  06538401-2115-7838-8000-234c29f83b38 : VotingOcrEngine@1809103 Extract error                                                                                                                                
       Traceback (most recent call last):                                                                                                                                                                          
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 128, in process_single                                                                                                             
           results = self.__process_extract_regions(                                                                                                                                                               
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 340, in __process_extract_regions                                                                                                  
           raise ex                                                                                                                                                                                                
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 284, in __process_extract_regions                                                                                                  
           overlay[padding : h + padding, padding : w + padding] = img                                                                                                                                             
       ValueError: could not broadcast input array from shape (30,0,3) into shape (30,254,3)                                                                                                                       
Traceback (most recent call last):
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/voting_ocr_engine.py", line 93, in extract
    results = self.process_single(
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 141, in process_single
    raise error
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 128, in process_single
    results = self.__process_extract_regions(
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 340, in __process_extract_regions
    raise ex
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 284, in __process_extract_regions
    overlay[padding : h + padding, padding : w + padding] = img
ValueError: could not broadcast input array from shape (30,0,3) into shape (30,254,3)
INFO   06538401-2115-7838-8000-234c29f83b38 : VotingOcrEngine@1809103 Voting evaluator                                                                                                                             
WARNI… 06538401-2115-7838-8000-234c29f83b38 : VotingOcrEngine@1809103 No results to evaluate                                                                                                                       
ERROR  06538401-2115-7838-8000-234c29f83b38 : TextExtractionExecutor@1809103 Extract error : 'NoneType' object does not support item assignment                                                                    
       Traceback (most recent call last):                                                                                                                                                                          
         File "/home/gbugaj/dev/marieai/marie-ai/marie/executor/text/text_extraction_executor.py", line 168, in extract                                                                                            
           metadata = self.pipeline.execute(                                                                                                                                                                       
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/extract_pipeline.py", line 648, in execute                                                                                                              
           return self.execute_regions_pipeline(                                                                                                                                                                   
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/extract_pipeline.py", line 567, in execute_regions_pipeline                                                                                             
           results = self.ocr_frames(                                                                                                                                                                              
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/extract_pipeline.py", line 449, in ocr_frames                                                                                                           
           results = engine.extract(frames, ps_mode, coord_format, regions)                                                                                                                                        
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/voting_ocr_engine.py", line 111, in extract                                                                                                             
           return self.voting_evaluator(aggregated_results, default_results, regions)                                                                                                                              
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/voting_ocr_engine.py", line 268, in voting_evaluator                                                                                                    
           output_results["regions"] = []                                                                                                                                                                          
       TypeError: 'NoneType' object does not support item assignment                                                                                                                                               
ERROR              : extract_t/rep-0@1809103 ValueError('Unexpected type')                                                                                                                      [10/24/23 17:07:14]
        add "--quiet-error" to suppress the exception details                                                                                                                                                      
       Traceback (most recent call last):                                                                                                                                                                          
         File "/home/gbugaj/dev/marieai/marie-ai/marie/serve/runtimes/worker/request_handling.py", line 1087, in process_data                                                                                      
           result = await self.handle(                                                                                                                                                                             
         File "/home/gbugaj/dev/marieai/marie-ai/marie/serve/runtimes/worker/request_handling.py", line 717, in handle                                                                                             
           _ = self._set_result(requests, return_data, docs)                                                                                                                                                       
         File "/home/gbugaj/dev/marieai/marie-ai/marie/serve/runtimes/worker/request_handling.py", line 556, in _set_result                                                                                        
           requests[0].parameters = params                                                                                                                                                                         
         File "/home/gbugaj/dev/marieai/marie-ai/marie/types/request/data.py", line 316, in parameters                                                                                                             
           self.proto_wo_data.parameters.update(parameters)                                                                                                                                                        
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 820, in update                                                             
           _SetStructValue(self.fields[key], value)                                                                                                                                                                
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 746, in _SetStructValue                                                    
           struct_value.struct_value.update(value)                                                                                                                                                                 
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 820, in update                                                             
           _SetStructValue(self.fields[key], value)                                                                                                                                                                
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 746, in _SetStructValue                                                    
           struct_value.struct_value.update(value)                                                                                                                                                                 
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 820, in update                                                             
           _SetStructValue(self.fields[key], value)                                                                                                                                                                
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 751, in _SetStructValue                                                    
           raise ValueError('Unexpected type')                                                                                                                                                                     
       ValueError: Unexpected type