o
    e                     @   s   d dl Z d dlZdd ZeddZdZeddZd	Zed
dZeddZ	eddZ
eddZeddZeddZeddZeddZeddZddgZdZdZd Zd!Zd"Zed#i d$Zd'd%d&ZdS )(    Nc                 C   s   t j}|dkrt jt dd}n
t jt dd}t jd|d}t j|rCt|}t|}W d   n1 s=w   Y  ni }t | durQt | S | |	 v r[||  S |S )	a  Retrieves the configuration variable conditionally.
        ##1. check if variable is in environment
        ##2. check if variable is in config file
        ##3. return default value
    Args:
        key (string): The name of the configuration variable.
        default (string): The default value of the configuration variable.
    Returns:
        string: The value of the conditional configuration variable.
    ntUSERPROFILEzroboflow/config.jsonHOMEz.config/roboflow/config.jsonROBOFLOW_CONFIG_DIRdefaultN)
osnamepathjoingetenvexistsopenjsonloadkeys)keyr   os_namedefault_pathconf_locationfconfig r   >/var/www/myenv/lib/python3.10/site-packages/roboflow/config.py&get_conditional_configuration_variable   s&   

r   CLASSIFICATION_MODELClassificationModelInstanceSegmentationModelOBJECT_DETECTION_MODELObjectDetectionModelSemanticSegmentationModelPREDICTION_OBJECT
PredictionAPI_URLzhttps://api.roboflow.comAPP_URLzhttps://app.roboflow.comUNIVERSE_URLzhttps://universe.roboflow.comINSTANCE_SEGMENTATION_URLzhttps://outline.roboflow.comSEMANTIC_SEGMENTATION_URLzhttps://segment.roboflow.comOBJECT_DETECTION_URLzhttps://detect.roboflow.comCLIP_FEATURIZE_URLzCLIP FEATURIZE URL NOT IN ENVOCR_URLzOCR URL NOT IN ENVzcoco-128-samplezchess-sample-only-api-keyclassificationzobject-detectionzinstance-segmentationzsemantic-segmentationzPip Package Upload
workspacesr   c                 C   s|   t dd urt d S tdi d}dd | D }tdd d}||d }|| |}|p3tdd d}|r<|dd S d S )N
RF_API_KEYr,   r   c                 S   s   i | ]}|d  |qS )urlr   ).0wr   r   r   
<dictcomp>R   s    z)load_roboflow_api_key.<locals>.<dictcomp>RF_WORKSPACEapiKey)r   r   r   valuesget)workspace_urlRF_WORKSPACESworkspaces_by_urldefault_workspace_urldefault_workspace	workspacer   r   r   load_roboflow_api_keyN   s   r<   )N)r   r   r   r   r   INSTANCE_SEGMENTATION_MODELr   SEMANTIC_SEGMENTATION_MODELr!   r#   r$   r%   r&   r'   r(   r)   r*   	DEMO_KEYSTYPE_CLASSICATIONTYPE_OBJECT_DETECTIONTYPE_INSTANCE_SEGMENTATIONTYPE_SEMANTIC_SEGMENTATIONDEFAULT_BATCH_NAMEr7   r<   r   r   r   r   <module>   s8    (





