Coretex
coretex.coretex.sample.computer_vision_sample.computer_vision_sample.ComputerVisionSample Class Reference

Inherits ImageSample.

Public Member Functions

Optional[Self] createComputerVisionSample (cls, int datasetId, Union[Path, str] imagePath)
 

Detailed Description

    Represents sample linked to task of type Computer Vision from Coretex.ai

Definition at line 25 of file computer_vision_sample.py.

Member Function Documentation

◆ createComputerVisionSample()

Optional[Self] coretex.coretex.sample.computer_vision_sample.computer_vision_sample.ComputerVisionSample.createComputerVisionSample (   cls,
int  datasetId,
Union[Path, str]  imagePath 
)
    Creates a new sample from the provided path and adds sample to specified dataset

    Parameters
    ----------
    datasetId : int
id of dataset to which sample will be added
    imagePath : Union[Path, str]
path to the sample

    Returns
    -------
    Optional[Self] -> The created sample object or None if creation failed

    Example
    -------
    >>> from coretex import ComputerVisionSample
    \b
    >>> sample = ComputerVisionSample.createComputerVisionSample(1023, "path/to/file.jpeg")
    >>> if sample is None:
    print("Failed to create computer vision sample")

Definition at line 32 of file computer_vision_sample.py.

32  def createComputerVisionSample(cls, datasetId: int, imagePath: Union[Path, str]) -> Optional[Self]:
33  """
34  Creates a new sample from the provided path and adds sample to specified dataset
35 
36  Parameters
37  ----------
38  datasetId : int
39  id of dataset to which sample will be added
40  imagePath : Union[Path, str]
41  path to the sample
42 
43  Returns
44  -------
45  Optional[Self] -> The created sample object or None if creation failed
46 
47  Example
48  -------
49  >>> from coretex import ComputerVisionSample
50  \b
51  >>> sample = ComputerVisionSample.createComputerVisionSample(1023, "path/to/file.jpeg")
52  >>> if sample is None:
53  print("Failed to create computer vision sample")
54  """
55 
56  return cls.createImageSample(datasetId, imagePath)

The documentation for this class was generated from the following file: