def create_manifest():
  size = 0
  sample_list = []
  for i in range(19):
    size = size + 1
    source = prefix_text + "raw data" + str(i)
    usage = "TRAIN"
    annotations_list = []

    for j in range(1):
      annotation_type = "modelarts/" + text_entity
      if 0 == i % 2:
        annotation_name = "name"
      else:
        annotation_name = "location"
      annotation_creation_time = "2019-04-28 08:23:06"
      annotation_format = "manifest"
      annotation_property = {property_start_index: 0, property_end_index: 5}
      annotation_confidence = 0.8
      annotated_by = "human"
      annotations_list.append(
        Annotation(name=annotation_name, type=annotation_type,
                   confidence=annotation_confidence,
                   creation_time=annotation_creation_time,
                   annotated_by=annotated_by, annotation_format=annotation_format, property=annotation_property))
    sample_list.append(
      Sample(source=source, usage=usage, annotations=annotations_list))
  return DataSet(sample=sample_list, size=size)
Ejemplo n.º 2
0
def create_manifest():
    size = 0
    sample_list = []
    for i in range(19):
        size = size + 1
        source = prefix_s3 + "audio" + str(i) + ".wav"
        usage = "TRAIN"
        annotations_list = []

        for j in range(1):
            annotation_type = "modelarts/" + audio_content
            annotation_creation_time = "2019-04-28 08:23:06"
            annotation_format = "manifest"
            annotation_property = {property_content: "Hello world!"}
            annotation_confidence = 0.8
            annotated_by = "human"
            annotations_list.append(
                Annotation(type=annotation_type,
                           confidence=annotation_confidence,
                           creation_time=annotation_creation_time,
                           annotated_by=annotated_by,
                           annotation_format=annotation_format,
                           property=annotation_property))
        sample_list.append(
            Sample(source=source, usage=usage, annotations=annotations_list))
    return DataSet(sample=sample_list, size=size)
Ejemplo n.º 3
0
def create_manifest():
  size = 0
  sample_list = []
  for i in range(19):
    size = size + 1
    source = "s3://obs-ma/test/classification/datafiles/1_1550650984970_" + str(i) + ".jpg"
    inference_loc = "s3://obs-ma/test/classification/datafiles/1_1550650984970_" + str(i) + ".txt"
    sample_list.append(
      Sample(source=source, inference_loc=inference_loc))
  return DataSet(sample=sample_list, size=size)
def create_manifest():
    size = 0
    sample_list = []
    for i in range(10):
        size = size + 1
        source = "s3://obs-ma/test/classification/datafiles/1_1550650984970_" + str(
            i) + ".jpg"
        usage = "TRAIN"
        inference_loc = "s3://obs-ma/test/classification/datafiles/1_1550650984970_" + str(
            i) + ".txt"
        id = "XGDVGS" + str(i)
        annotations_list = []

        for j in range(1):
            annotation_type = "modelarts/image_classification"
            if 0 == i % 2:
                annotation_name = "Cat"
            else:
                annotation_name = "Dog"
            annotation_creation_time = "2019-02-20 08:23:06"
            annotation_format = "manifest"
            annotation_property = {"color": "black"}
            annotation_confidence = 0.8
            annotated_by = "human"
            annotations_list.append(
                Annotation(name=annotation_name,
                           type=annotation_type,
                           confidence=annotation_confidence,
                           creation_time=annotation_creation_time,
                           annotated_by=annotated_by,
                           annotation_format=annotation_format,
                           property=annotation_property))
        sample_list.append(
            Sample(source=source,
                   usage=usage,
                   annotations=annotations_list,
                   inference_loc=inference_loc,
                   id=id))

    for i in range(9):
        id = "XGDVGS" + str(i)
        size = size + 1
        source = "s3://obs-ma/test/classification/datafiles/1_1550650984970_" + str(
            i) + ".jpg"
        usage = "TRAIN"
        annotations_list = []
        inference_loc = "s3://obs-ma/test/classification/datafiles/1_1550650984970_" + str(
            i) + ".txt"
        sample_list.append(
            Sample(source=source,
                   usage=usage,
                   annotations=annotations_list,
                   inference_loc=inference_loc,
                   id=id))
    return DataSet(sample=sample_list, size=size)
Ejemplo n.º 5
0
def create_manifest(path_base, ak=None, sk=None, endpoint=None):
    size = 0
    sample_list = []
    for i in range(8):
        size = size + 1
        source = "s3://obs-ma/test/label-0220/datafiles/1 (15)_1550632618199" + str(
            i) + ".jpg"
        usage = "TRAIN"
        inference_loc = "s3://obs-ma/test/label-0220/datafiles/1 (15)_1550632618199" + str(
            i) + ".txt"
        annotations_list = []
        print("sample ", i)

        for j in range(2):
            annotation_type = "modelarts/object_detection"
            annotation_loc = "/000000089955_1556180702627_" + str(i) + str(
                j) + ".xml"
            annotation_creation_time = "2019-02-20 03:16:58"
            annotation_format = "PASCAL VOC"
            annotated_by = "human"
            annotations_list.append(
                Annotation(type=annotation_type,
                           loc="." + annotation_loc,
                           creation_time=annotation_creation_time,
                           annotated_by=annotated_by,
                           annotation_format=annotation_format))
            pascal_voc = test_write_voc_xml.create_pascal_voc()
            pascal_voc.save_xml(path_base + annotation_loc, ak, sk, endpoint)
            print("test write VOC xml: Success")

        sample_list.append(
            Sample(source=source,
                   usage=usage,
                   annotations=annotations_list,
                   inference_loc=inference_loc))
    return DataSet(sample=sample_list, size=size)