Ë
    ÷Gìjç  ã                   óX   — d dl Z d dlmZ d dlZddlmZ ddlmZ ddl	m
Z
 	 d
dedefd	„Zy)é    N)ÚTypeé   )Úsessions_class)ÚBaseSession)ÚU2netSessionÚ
model_nameÚreturnc                 ó>  — t         }t        D ]  }|j                  «       | k(  sŒ|} n t        j                  «       }dt
        j                  v rBt        t
        j                  d   «      |_        t        t
        j                  d   «      |_	         || ||g|¢­i |¤ŽS )aé  
    Create a new session object based on the specified model name.

    This function searches for the session class based on the model name in the 'sessions_class' list.
    It then creates an instance of the session class with the provided arguments.
    The 'sess_opts' object is created using the 'ort.SessionOptions()' constructor.
    If the 'OMP_NUM_THREADS' environment variable is set, the 'inter_op_num_threads' option of 'sess_opts' is set to its value.

    Parameters:
        model_name (str): The name of the model.
        providers: The providers for the session.
        *args: Additional positional arguments.
        **kwargs: Additional keyword arguments.

    Returns:
        BaseSession: The created session object.
    ÚOMP_NUM_THREADS)
r   r   ÚnameÚortÚSessionOptionsÚosÚenvironÚintÚinter_op_num_threadsÚintra_op_num_threads)r   Ú	providersÚargsÚkwargsÚsession_classÚscÚ	sess_optss          úYC:\Users\Stabi\Downloads\virtual-tryon(1)\venv\Lib\site-packages\rembg/session_factory.pyÚnew_sessionr      sŒ   € ô( (4€MçˆØ�7‰7‹9˜
Ó"ØˆMÙð ô
 ×"Ñ"Ó$€IàœBŸJ™JÑ&Ü),¬R¯Z©ZÐ8IÑ-JÓ)Kˆ	Ô&Ü),¬R¯Z©ZÐ8IÑ-JÓ)Kˆ	Ô&á˜ Y°	ÐK¸DÒKÀFÑKÐKó    )Úu2netN)r   Útypingr   Úonnxruntimer   Úsessionsr   Úsessions.baser   Úsessions.u2netr   Ústrr   © r   r   Ú<module>r%      s4   ðÛ 	Ý ã å $Ý &Ý (ð *.ñ!LØð!Làô!Lr   