<h3 dir="auto">System Info</h3>
<p dir="auto">I'm using LayoutLMv3Processor to encoding.<br>
when I input (1, 82, 4) as boxes, the processor will extends the boxes to (1, 512, 4), but some boxes of input is dropped by processor as I can't find them in the encoding;<br>
seems the last n boxes is dropped.</p>
<p dir="auto"><strong><em>tokenizer = LayoutLMv3TokenizerFast.from_pretrained('microsoft/layoutlmv3-base')<br>
processor = LayoutLMv3Processor(LayoutLMv3FeatureExtractor(apply_ocr=False), tokenizer)</em></strong></p>
<p dir="auto"><strong>boxes of before encoding (512, 4)<br>
boxes of after encoding (82, 4)<br>
boxes of before encoding without duplicated  (58, 4)<br>
boxes of after encoding without duplicated (82, 4)</strong></p>
<h3 dir="auto">Who can help?</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Information</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The official example scripts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> My own modified scripts</li>
</ul>
<h3 dir="auto">Tasks</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> An officially supported task in the <code class="notranslate">examples</code> folder (such as GLUE/SQuAD, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<p dir="auto">import numpy as np<br>
from PIL import Image<br>
from transformers import LayoutLMv3Processor, LayoutLMv3TokenizerFast, LayoutLMv3FeatureExtractor, <br>
LayoutLMv3ForTokenClassification, AutoModelForTokenClassification, AutoConfig<br>
from inference_util import prepare_annotation,load_original_dataset</p>
<p dir="auto">image_paths,bboxes,ner_tags=load_original_dataset("cro_vl_fr/","test")</p>
<p dir="auto">tokenizer = LayoutLMv3TokenizerFast.from_pretrained('microsoft/layoutlmv3-base')<br>
processor = LayoutLMv3Processor(LayoutLMv3FeatureExtractor(apply_ocr=False), tokenizer)</p>
<p dir="auto">item = image_paths[0]<br>
image = Image.open( item).convert("RGB")</p>
<h1 dir="auto">get word-level annotations</h1>
<p dir="auto">image,words,boxes=prepare_annotation(image,bboxes[0])<br>
boxes_2_points= np.hstack((np.array(boxes)[:,0:2],np.array(boxes)[:,4:6])).astype(int)</p>
<p dir="auto">encoding = processor(image, words, boxes=boxes_2_points,<br>
padding="max_length", truncation=True,<br>
return_tensors="pt")</p>
<p dir="auto">for k,v in encoding.items():<br>
encoding[k] = v.squeeze()</p>
<p dir="auto">token_boxes = encoding['bbox'].numpy()</p>
<p dir="auto">print("boxes of before encoding",np.shape(token_boxes))<br>
print("boxes of after encoding",np.shape(boxes_2_points))<br>
token_boxes=[tuple(a) for a in token_boxes]<br>
token_boxes=np.array(list(set(token_boxes)))<br>
boxes_2_points=[tuple(a) for a in boxes_2_points]<br>
boxes_2_points=np.array(list(set(boxes_2_points)))</p>
<p dir="auto">print("boxes of before encoding without duplicated ",np.shape(token_boxes))<br>
print("boxes of after encoding without duplicated",np.shape(boxes_2_points))</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">original boxes should not be drop.</p>
<p dir="auto">The link to the example/summarization folder in <a href="https://huggingface.co/transformers/examples.html#the-big-table-of-tasks" rel="nofollow">the-big-table-of-tasks</a> is broken because the folder's name has been changed to seq2seq</p>