【问题标题】:How to create an SFrame compatible with TuriCreate for object detection task如何为对象检测任务创建与 TuriCreate 兼容的 SFrame
【发布时间】:2020-12-03 13:28:38
【问题描述】:

我正在尝试创建一个包含图像和边界框坐标的SFrame,以便使用TuriCreate 执行对象检测。 我通过IBM Cloud Annotations 创建了自己的数据集,导出为CreateML 格式。当我跑步时:

usage_data = tc.SFrame.read_json("annotations.json")

我明白了:

[{'label': 'xyz'... | 8be1172e-44bb-4084-917f-db....

这不是请求的格式。确认运行以下代码:

data = tc.SFrame.read_json("annotations.json")

train_data, test_data = data.random_split(0.75)

model = tc.object_detector.create(train_data)

predictions = model.predict(test_data)

`我明白了:

ToolkitError: No "feature" column specified and no column with expected type "image" is found. "datasets" consists of columns with types: list, str.

我想知道:

  1. CreateML格式的导出数据是否正确?
  2. 我可以使用SFrame.read_json() 来读取此类数据吗?

【问题讨论】:

    标签: object-detection sframe createml


    【解决方案1】:

    您需要从您的图像文件夹中创建一个 SFrame,然后将其加入到您的注释 SFrame 中,例如:

    imagesSFrame = turicreate.image_analysis.load_images('imagesFolder/')
    combinedSFrame = images.join(annotationsSFrame)
    

    只需确保您的每个注释都有一个与您的 imagesSFrame 中的路径完全匹配的路径。以下是我的 csv 格式:

    path, annotation,
    imagesFolder/image1.png,[{'label': 'dog', 'coordinates': {'height': 118, 'width': 240, 'x': 155, 'y': 129}}]
    

    print(imagesSFrame) 将允许您检查 imagesSFrame 中的路径

    【讨论】:

      猜你喜欢
      • 2018-11-12
      • 2018-12-18
      • 2019-12-26
      • 2017-09-17
      • 1970-01-01
      • 2014-09-19
      • 1970-01-01
      • 2018-04-24
      • 2022-01-13
      相关资源
      最近更新 更多