layout-parser
layout-parser copied to clipboard
Empty label_map
Describe the bug
config_path, model_path = self.config_parser(
config_path, model_path, allow_empty_path=True
)
config_path = PathManager.get_local_path(config_path)
if label_map is None:
if config_path.startswith("lp://"):
dataset_name = config_path.lstrip("lp://").split("/")[1]
label_map = LABEL_MAP_CATALOG[dataset_name]
else:
label_map = {}
In src/layoutparser/models/detectron2/layoutmodel.py, config_pathis parsed and translated to a local path before it is parsed for label_map, and label_map becomes empty as a result.
Checklist
- I have searched related issues but cannot get the expected help.
- The bug has not been fixed in the latest version, see the Layout Parser Releases
To Reproduce Steps to reproduce the behavior:
- What command or script did you run?
import layoutparser as lp
model = lp.AutoLayoutModel("lp://detectron2/PubLayNet/faster_rcnn_R_50_FPN_3x")
model.label_map != {}
Environment
- Please describe your Platform [Windows/MacOS/Linux]: macOS
- Please show the Layout Parser version: 0.3.4
- You may add addition that may be helpful for locating the problem, such as
- How you installed PyTorch [e.g., pip, conda, source]
- Other environment variables that may be related (such as
$PATH,$LD_LIBRARY_PATH,$PYTHONPATH, etc.)
Error traceback If applicable, paste the error traceback here.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.