简体   繁体   English

如何为 object 检测任务创建与 TuriCreate 兼容的 SFrame

[英]How to create an SFrame compatible with TuriCreate for object detection task

I am trying to create an SFrame containing images and bounding boxes' coordinates, in order to perform object detection using TuriCreate .我正在尝试创建一个包含图像和边界框坐标的SFrame ,以便使用TuriCreate执行 object 检测。 I have created my own dataset by IBM Cloud Annotations , exported as CreateML format.我通过IBM Cloud Annotations创建了自己的数据集,并以CreateML格式导出。 When I run:当我运行时:

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

I get:我得到:

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

Which is not the format requested.这不是要求的格式。 It is confirmed running the code below:确认运行以下代码:

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)

`I get: `我得到:

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

I would like to know:我想知道:

  1. Is it correct export data in CreateML format? CreateML格式的导出数据是否正确?
  2. Can I use SFrame.read_json() for reading this kind of data?我可以使用SFrame.read_json()来读取这种数据吗?

You need to create an SFrame from your images folder and then join it to your annotations SFrame like:您需要从您的图像文件夹中创建一个 SFrame,然后将其加入到您的注释 SFrame 中,例如:

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

Just make sure that your annotations each have a path that exactly matches the path in your imagesSFrame.只需确保您的每个注释都有一个与您的 imagesSFrame 中的路径完全匹配的路径。 Below is my csv format:下面是我的 csv 格式:

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

print(imagesSFrame) will allow you to inspect what the path is inside your imagesSFrame print(imagesSFrame)将允许您检查 imagesSFrame 内的路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对象检测API - 如何创建一组训练? - Object Detection API - How to create an Ensemble of trainings? 创建自定义检测 model - 图像 Object 检测 - Create custom detection model - Image Object Detection 如何在caffe中创建用于对象检测的数据集? - How can one create a dataset for object detection in caffe? 如何在Tensorflow对象检测中为自定义标签创建tfrecord? - how to create tfrecord for custom labels in Tensorflow object detection? 如何在对象检测任务中将水平边界框转换为定向边界框 - How to convert horizontal bounding box to oriented bounding box in object detection task 如何使用Eclipse在Android上创建具有特定对象检测功能的相机应用程序? - How to create camera application with specific object detection on android using eclipse? 如何改善物体检测? - How to improve object detection? 如何将图像和注释拆分为 object 检测任务的训练、测试和验证集? - How to split the images and annotations into train, test and validation sets for an object detection task? 为TensorFlow / Keras创建对象检测数据集 - Create an object detection dataset for TensorFlow/Keras 创建对象检测边界框的最佳方法 - Best Way to create a bounding box for object detection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM