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

Public Member Functions

BaseConverter create (self, str datasetName, int spaceId, 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.coretex.conversion.converter_processor_factory.ConverterProcessorFactory.create (   self,
str  datasetName,
int  spaceId,
str  datasetPath 
)
    Creates BaseConverter based on the convertProcessorType
    property of the class

    Parameters
    ----------
    datasetName : str
name of dataset
    spaceId : int
id of Coretex Space
    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, spaceId: 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  spaceId : int
49  id of Coretex Space
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, spaceId, datasetPath)
61 
62  if self.type == ConverterProcessorType.yolo:
63  return YoloConverter(datasetName, spaceId, datasetPath)
64 
65  if self.type == ConverterProcessorType.createML:
66  return CreateMLConverter(datasetName, spaceId, datasetPath)
67 
68  if self.type == ConverterProcessorType.voc:
69  return VOCConverter(datasetName, spaceId, datasetPath)
70 
71  if self.type == ConverterProcessorType.labelMe:
72  return LabelMeConverter(datasetName, spaceId, datasetPath)
73 
74  if self.type == ConverterProcessorType.pascalSeg:
75  return PascalSegConverter(datasetName, spaceId, datasetPath)
76 
77  if self.type == ConverterProcessorType.humanSegmentation:
78  return HumanSegmentationConverter(datasetName, spaceId, datasetPath)
79 
80  if self.type == ConverterProcessorType.cityScape:
81  return CityScapeConverter(datasetName, spaceId, datasetPath)
82 
83  raise RuntimeError()

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