18 from typing
import Optional
20 from .converter_processor_factory
import ConverterProcessorFactory
21 from .base_converter
import ConverterProcessorType
22 from ..dataset
import ImageDataset
25 def convert(type: ConverterProcessorType, datasetName: str, projectId: int, datasetPath: str) -> Optional[ImageDataset]:
27 Converts and uploads the given dataset to Coretex Format
31 type : ConverterProcessorType
32 dataset format type (coco, yolo, createML, voc, labelMe, pascalSeg)
42 Optional[ImageDataset] -> The converted ImageDataset object
46 >>> from coretex import convert, ConverterProcessorType
48 >>> dataset = convert(
49 type = ConvertProcessorType.coco,
50 datasetName = "coretex_dataset",
52 datasetPath = "path/to/dataset"
54 >>> if dataset is not None:
55 print("Dataset converted successfully")
58 return ConverterProcessorFactory(type).create(datasetName, projectId, datasetPath).convert()