[英]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:我想知道:
CreateML
format? CreateML
格式的导出数据是否正确?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.