o
    e                     @   s0   d dl mZmZ d dlmZ G dd deZdS )    )SEMANTIC_SEGMENTATION_MODELSEMANTIC_SEGMENTATION_URL)InferenceModelc                       sJ   e Zd ZdZdedef fddZddedef fd	d
Zdd Z  Z	S )SemanticSegmentationModelzq
    Run inference on a semantic segmentation model hosted on Roboflow or served through Roboflow Inference.
    api_key
version_idc                    s0   t t| || t d| j d| j | _dS )z
        Create a SemanticSegmentationModel object through which you can run inference.

        Args:
            api_key (str): private roboflow api key
            version_id (str): the workspace/project id
        /N)superr   __init__r   
dataset_idversionapi_url)selfr   r   	__class__ T/var/www/myenv/lib/python3.10/site-packages/roboflow/models/semantic_segmentation.pyr
   
   s   z"SemanticSegmentationModel.__init__2   
image_path
confidencec                    s   t t| j||tdS )ac  
        Infers detections based on image from a specified model and image path.

        Args:
            image_path (str): path to the image you'd like to perform prediction on
            confidence (int): confidence threshold for predictions, on a scale from 0-100

        Returns:
            PredictionGroup Object

        Example:
            >>> import roboflow

            >>> rf = roboflow.Roboflow(api_key="")

            >>> project = rf.workspace().project("PROJECT_ID")

            >>> model = project.version("1").model

            >>> prediction = model.predict("YOUR_IMAGE.jpg")
        )r   prediction_type)r	   r   predictr   )r   r   r   r   r   r   r      s
   
z!SemanticSegmentationModel.predictc                 C   s"   dt | j d| j d| j dS )N<z id=z
, api_url=>)type__name__idr   )r   r   r   r   __str__1   s   "z!SemanticSegmentationModel.__str__)r   )
r   
__module____qualname____doc__strr
   intr   r   __classcell__r   r   r   r   r      s
    r   N)roboflow.configr   r   roboflow.models.inferencer   r   r   r   r   r   <module>   s    