Coretex
coretex.entities.conversion.converter_processor_factory.ConverterProcessorFactory Class Reference

Public Member Functions

BaseConverter create (self, str datasetName, int projectId, str datasetPath)
 

Detailed Description

    Factory class used to create different types
    of BaseConverter objects based on the convertProcessorType
    property of the class

    Properties
    ----------
    convertProcessorType : ConverterProcessorType
        type of converter for convertin dataset

Definition at line 24 of file converter_processor_factory.py.

Member Function Documentation

◆ create()

BaseConverter coretex.entities.conversion.converter_processor_factory.ConverterProcessorFactory.create (   self,
str  datasetName,
int  projectId,
str  datasetPath 
)
    Creates BaseConverter based on the convertProcessorType
    property of the class

    Parameters
    ----------
    datasetName : str
        name of dataset
    projectId : int
        id of Coretex Project
    datasetPath : str
        path to dataset

    Returns
    -------
    Appropriate BaseConverter object based on
    convertProcessorType

Definition at line 39 of file converter_processor_factory.py.

39  def create(self, datasetName: str, projectId: int, datasetPath: str) -> BaseConverter:
40  """
41  Creates BaseConverter based on the convertProcessorType
42  property of the class
43 
44  Parameters
45  ----------
46  datasetName : str
47  name of dataset
48  projectId : int
49  id of Coretex Project
50  datasetPath : str
51  path to dataset
52 
53  Returns
54  -------
55  Appropriate BaseConverter object based on
56  convertProcessorType
57  """
58 
59  if self.type == ConverterProcessorType.coco:
60  return COCOConverter(datasetName, projectId, datasetPath)
61 
62  if self.type == ConverterProcessorType.yolo:
63  return YoloConverter(datasetName, projectId, datasetPath)
64 
65  if self.type == ConverterProcessorType.createML:
66  return CreateMLConverter(datasetName, projectId, datasetPath)
67 
68  if self.type == ConverterProcessorType.voc:
69  return VOCConverter(datasetName, projectId, datasetPath)
70 
71  if self.type == ConverterProcessorType.labelMe:
72  return LabelMeConverter(datasetName, projectId, datasetPath)
73 
74  if self.type == ConverterProcessorType.pascalSeg:
75  return PascalSegConverter(datasetName, projectId, datasetPath)
76 
77  if self.type == ConverterProcessorType.humanSegmentation:
78  return HumanSegmentationConverter(datasetName, projectId, datasetPath)
79 
80  if self.type == ConverterProcessorType.cityScape:
81  return CityScapeConverter(datasetName, projectId, datasetPath)
82 
83  raise RuntimeError()

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