Closed mzhadigerov closed 2 years ago
Hi @mzhadigerov ! The reason for your issue is that lp.Detectron2LayoutModel
and lp.EfficientDetLayoutModel
use different configuration "systems". So you might want to directly use some models here https://layout-parser.github.io/platform/
by copying the corresponding weights. For example, if you'd want to try with the MFD model using efficientdet, you can just hit the copy button (indicated by the red arrows in the screenshot below) and it will give you the code for instantiating the corresponding model lp.AutoModel("lp://efficientdet/MFD/tf_efficientdet_d0")
. I would say this is more like a documentation issue rather than a bug -- and I'll update the modeling documentations very soon!
But I don't want to use a pre-trained model from https://layout-parser.github.io/platform/
. I used https://github.com/Layout-Parser/layout-model-training
to train a model on my own dataset. As you can see in the question, I'm referring to
config_path = /content/drive/MyDrive/models/id_card_detection/config.yaml
and model_path = /content/drive/MyDrive/models/id_card_detection/model_final.pth
.
Yes for now the layout-model-training only works for Detectron2 based models (and thus you can only use the yaml for lp.Detectron2LayoutModel
. And we'll provide the code for training EfficientDet models soon.
When I run:
everything works fine, but when I run:
I'm getting the error: