Google Cloud AutoML 对象检测导出 CSV 对象位置

Google Cloud AutoML Object Detection export CSV object positions

我已经使用 Google Cloud AutoML 标签工具在图像上标记了对象。比我导出的 csv 文件。这是输出:

TRAIN,gs://optik-vcm/optikic/80-2020-03-19T11:58:25.819Z.jpg,kenarcizgi,0.92590326,0.035908595,0.9589712,0.035908595,0.9589712,0.9020675,0.92590326,0.9020675

论美,是这样的:

TRAIN
gs://optik-vcm/optikic/80-2020-03-19T11:58:25.819Z.jpg
kenarcizgi
0.92590326
0.035908595
0.9589712
0.035908595
0.9589712
0.9020675
0.92590326
0.9020675

我知道前三列。

我将通过数据扩充来增加图像数量。为此,我将在 Python 中使用 OpenCV。但我需要图像上物体的坐标。

如何将这些小数转换为像素坐标?或者有什么计算方法吗?

这些被称为 NormalizedVertex

A vertex represents a 2D point in the image. The normalized vertex coordinates are between 0 to 1 fractions relative to the original plane (image, video). E.g. if the plane (e.g. whole image) would have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would be at the position (1, 6) on that plane.

要获得像素坐标,您可以根据需要将该数字乘以输入的宽度或长度。


整个 reference for the CSV formatting 解释了以下(截断的)构成每一行(每个边界框或每个图像一行):

  • TRAIN - 哪个集合将这一行的内容赋值给
  • gs://optik-vcm/... - Google 云存储 URI
  • kenarcizgi - 标识对象分类方式的标签
  • 图像中对象的边界框:
    • x_relative_miny_relative_minx_relative_maxy_relative_minx_relative_maxy_relative_maxx_relative_miny_relative_max