Comments (6)
@gwkrsrch, could you give us the code that was used to generate the heatmap visualization in Figure 8 of the DONUT paper?
from donut.
Hi, thanks to @logan-markewich for the helpful comment :)
donut
does not require any bounding box annotation/supervision during the model training. But, as a result, there are no actual boxes in the model output. Instead, you can get an attention heatmap that could be used for your purpose. See Figure 8 of https://arxiv.org/abs/2111.15664 also. The related code line is at:
You may convert the heatmap to bounding boxes. The following link might be useful to you:
Hope this helps. Please let me know if you are still confused.
from donut.
@WeiquanWa , did you manage to get some semblance of bounding boxes or the cross-attention heatmap from the outputs?
I cannot interpret the structure of the output attention maps from "cross_attentions": decoder_output.cross_attentions
.
I see it is a tuple of tuples with the outer length being equal to the number of tokens (len(decoder_output.sequences)
) but there are 4 sub-tuples inside each of shape torch.Size([1, 16, 1, 1200])
. Not sure how to get representative heatmaps from these tensors.
from donut.
As far as I know, there isn't actually any bounding boxes. The image is encoded into features, but not actual boxes.
If you need boxes, you are better off using traditional OCR + modelling (layoutlmv2/3 are great options for this approach)
from donut.
I second this question. I assume these attention masks are to be translated to the prior stage (before they were encoded) to be able to match with the actual image shape, but I can't seem to figure out how to do this.
Like suggested in #31, I think Donut would benefit greatly from returning bounding boxes to allow further post-processing and output validation using fuzzy matching approaches with OCR results.
from donut.
I've found updates at #45
from donut.
Related Issues (20)
- How to extract complete text from the document? HOT 3
- confidence 값의 공식적인 지원
- Classification inference
- Update donut-python Python Package to be compatible with latest versions of transformers
- donut inference시 sub task가 변경?
- Not getting prediction correctly using the model trained on the custom dataset (similar format as CORD-V2 dataset) HOT 6
- not work this app.py
- Can synthdog insert text for a specified bbox? HOT 1
- Where is the fine-tuned model?
- Why is the output of the intermediate verification empty after training?
- Donut generate ONLY <s><s>...<s></s> HOT 7
- Performance of the model HOT 1
- How to improve OCR accuracy for Japanese characters? HOT 2
- Early Stopping
- How many documents(invoices) are required for training model for document information extraction?
- What should be the configuration of the machine to train the model?
- Hindi Synthdog
- How to interpret the results of the Japanese document?
- Issue with Fine-Tuning: Incorrect Answers When Querying Specific Questions HOT 1
- DocVQA input input_ids at training time HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from donut.