
    Ng                         d dl mZmZmZmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ej        eej        ee
j        e
iZ	 	 	 	 dded	ee         d
ee         dee         deeeef                  ddfdZdS )    )OptionalDictUnionList   )Detectron2LayoutModel)PaddleDetectionLayoutModel)EfficientDetLayoutModel)$is_lp_layout_model_config_any_formatNconfig_path
model_path	label_mapdeviceextra_configreturnBaseLayoutModelc                     t          |           st          d|            t          D ]"}|| v rt          |         | ||||          c S #dS )a  [summary]

    Args:
        config_path (:obj:`str`):
            The path to the configuration file.
        model_path (:obj:`str`, None):
            The path to the saved weights of the model.
            If set, overwrite the weights in the configuration file.
            Defaults to `None`.
        label_map (:obj:`dict`, optional):
            The map from the model prediction (ids) to real
            word labels (strings). If the config is from one of the supported
            datasets, Layout Parser will automatically initialize the label_map.
            Defaults to `None`.
        device(:obj:`str`, optional):
            Whether to use cuda or cpu devices. If not set, LayoutParser will
            automatically determine the device to initialize the models on. 
        extra_config (:obj:`dict`, optional):
            Extra configuration passed used for initializing the layout model.

    Returns:
        # BaseLayoutModel: the create LayoutModel instance
    zInvalid model config_path )r   r   r   r   N)r   
ValueErrorALL_AVAILABLE_BACKENDS)r   r   r   r   r   backend_names         `/var/www/html/ai-engine/env/lib/python3.11/site-packages/layoutparser/models/auto_layoutmodel.pyAutoLayoutModelr      s    < 0<< ECkCCDDD.  ;&&),7%#)      '     )NNNN)typingr   r   r   r   detectron2.layoutmodelr   paddledetection.layoutmodelr	   effdet.layoutmodelr
   model_configr   DETECTOR_NAMEr   strr    r   r   <module>r"      s'   / . . . . . . . . . . . 9 9 9 9 9 9 C C C C C C 7 7 7 7 7 7     
 ')>,.H)+B  !%".2( ((( ~( SM	(
 5t,-( ( ( ( ( ( (r   