Layout-Parser / layout-parser

A Unified Toolkit for Deep Learning Based Document Image Analysis
https://layout-parser.github.io/
Apache License 2.0
4.78k stars 459 forks source link

Minor update to Deep Learning Parser example notebook #56

Closed Jim-Salmons closed 2 years ago

Jim-Salmons commented 3 years ago

The current version of the Deep Learning Parsing example Notebook lacks the inplace=True parameter on the sort method call to the Layout instance in the left Interval. The master version's large block of image data shows these TextBlock's ids in top-down sequential order. Running the Notebook as written, however, will refresh the Notebook page image with out of sequence ids due to the default of the inplace parameter being False. The current master Notebook will produce the following image post-refresh: actual-dlp-example-img For instructional clarity, this version also casts the right_blocks variable as a Layout instance initialized with the TextBlock instances not in the left Interval and with inplace=True to ensure the intended sort sequencing of block ids.

A few non-essential additions to the source comments are added relative to the changes described.

Please note: At 70 years of age, this is my first PR to a public repository. I started my career with no CompSci or engineering experience as a Control Data PLATO developer. I then spent the bulk of my career in Programmer Nirvana as a Smalltalk developer on small teams with brilliant engineers who did all the necessary heavy lifting of integration and testing while I got to explore the nether regions of proof-of-concept ideas. So this is truly a learning experience for me. Any pointers or advice to make this PR useful and acceptable will be greatly appreciated.

lolipopshock commented 2 years ago

Thank you for the updates, @Jim-Salmons ! I added some minor tweaks to your updates to minimize the unnecessary/hidden Jupyter Notebook changes. But other than that all looks great!