Jelajahi Sumber

Merge pull request #2220 from myhloli/refactor-pipeline

fix(magic_pdf): correct range for images in document analysis
Xiaomeng Zhao 7 bulan lalu
induk
melakukan
99ab04f588
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      magic_pdf/model/doc_analyze_by_custom_model.py

+ 1 - 1
magic_pdf/model/doc_analyze_by_custom_model.py

@@ -147,7 +147,7 @@ def doc_analyze(
             images.append(img_dict['img'])
             page_wh_list.append((img_dict['width'], img_dict['height']))
 
-    images_with_extra_info = [(images[index], ocr, dataset._lang) for index in range(len(dataset))]
+    images_with_extra_info = [(images[index], ocr, dataset._lang) for index in range(len(images))]
 
     if len(images) >= MIN_BATCH_INFERENCE_SIZE:
         batch_size = MIN_BATCH_INFERENCE_SIZE