
    kh"	                         d dl mZ ddlmZ ddddddd	Zd
dddddddid	Z G d de      Z ej                   e              y)    )PathHandler   )PathManagerzShttps://www.dropbox.com/s/ukbw5s673633hsw/publaynet-tf_efficientdet_d0.pth.tar?dl=1zShttps://www.dropbox.com/s/gxy11xkkiwnpgog/publaynet-tf_efficientdet_d1.pth.tar?dl=1)tf_efficientdet_d0tf_efficientdet_d1zMhttps://www.dropbox.com/s/dkr22iux7thlhel/mfd-tf_efficientdet_d0.pth.tar?dl=1zMhttps://www.dropbox.com/s/icmbiaqr5s9bz1x/mfd-tf_efficientdet_d1.pth.tar?dl=1)	PubLayNetMFDTextTitleListTableFigure)   r            r   Equationc                   (    e Zd ZdZdZd Zd ZddZy)$LayoutParserEfficientDetModelHandlerz<
    Resolve anything that's in LayoutParser model zoo.
    zlp://efficientdet/c                     | j                   gS N)PREFIX)selfs    ^/var/www/teggl/fontify/venv/lib/python3.12/site-packages/layoutparser/models/effdet/catalog.py_get_supported_prefixesz<LayoutParserEfficientDetModelHandler._get_supported_prefixes4   s    }    c                     |t        | j                        d  }|j                  d      ^}}}|dk(  rt        |   dj	                  |         }nt        d|       t        j                  |fi |S )N/weightzUnknown data_type )lenr   splitMODEL_CATALOGjoin
ValueErrorr   get_local_path)r   pathkwargs
model_namedataset_name	data_type	model_urls          r   _get_local_pathz4LayoutParserEfficientDetModelHandler._get_local_path7   sx    #dkk*,-
/9/?/?/D,z9 %l3CHHZ4HII1)=>>)))>v>>r   c                 N    t        j                  | j                  |      |fi |S r   )r   openr,   )r   r&   moder'   s       r   _openz*LayoutParserEfficientDetModelHandler._openB   s%     4 4T :DKFKKr   N)r)__name__
__module____qualname____doc__r   r   r,   r0    r   r   r   r   -   s     "F	?Lr   r   N)iopath.common.file_ior   base_catalogr   r"   LABEL_MAP_CATALOGr   register_handlerr6   r   r   <module>r;      s~    . & ts
 nm	  	
: L; L2   AC Dr   