
    Ng                         d dl Z d dlZddZdS )    N c                    t          | t                    rt          s
J d            | S | }t          j                            |          sLt          j                            ||          }t          j                            |          sJ d| z              t          j                            |           d                                         }|dk    rAt          |          5 }d t          |          D             }d d d            n# 1 swxY w Y   nQ|dk    r=t          |d          5 }t          j        |          }d d d            n# 1 swxY w Y   nJ d	| d
            |S )Nz class_map dict must be non-emptyz+Cannot locate specified class map file (%s)z.txtc                 >    i | ]\  }}|                                 |S  )strip).0kvs      W/var/www/html/ai-engine/env/lib/python3.11/site-packages/timm/data/readers/class_map.py
<dictcomp>z"load_class_map.<locals>.<dictcomp>   s&    BBBTQAGGIIqBBB    z.pklrbFz&Unsupported class map file extension (z).)
isinstancedictospathexistsjoinsplitextloweropen	enumeratepickleload)map_or_filenamerootclass_map_pathclass_map_extfclass_to_idxs         r   load_class_mapr"      s   /4(( 777777$N7>>.)) odN;;w~~n--nn/\_n/nnnnG$$_55b9??AAM.!! 	CQBBYq\\BBBL	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C	&	 	 .$'' 	*1!;q>>L	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	QP}PPPPPPs$   "DDD*EEE)r   )r   r   r"   r   r   r   <module>r#      s5    				      r   