>>> import layoutparser as lp
>>> list(lp.models.auto_layoutmodel.ALL_AVAILABLE_BACKENDS)
['detectron2', 'paddledetection', 'efficientdet']
i.e., 'efficientdet' is not in 'lp://EfficientDete/PubLayNet'.
When AutoLayoutModel cannot find a model to instantiate, it silently returns None (because it returns nothing).
This means that we get AttributeError: 'NoneType' object has no attribute 'detect' during layout = model.detect(image)
Describe the bug README contains the following (since #73):
This fails to instantiate a valid model because
AutoLayoutModel
runs https://github.com/Layout-Parser/layout-parser/blob/89aca0320acbeb8348369dba060bd1c892fbd50f/src/layoutparser/models/auto_layoutmodel.py#L62-L63and
i.e., 'efficientdet' is not in 'lp://EfficientDete/PubLayNet'.
When
AutoLayoutModel
cannot find a model to instantiate, it silently returnsNone
(because it returns nothing). This means that we getAttributeError: 'NoneType' object has no attribute 'detect'
duringlayout = model.detect(image)
My suggestions are:
AutoLayoutModel
should complain if it fails auto detecting the model.# from PIL import Image
along README's# image = Image.open("path/to/image")