0

jpg の代わりに dicom 画像で tensorflow のオブジェクト検出 API を使用するのが好きです。

ドキュメント: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records 次のコードを見つけます

    # ...
    encoded_jpg_io = io.BytesIO(encoded_jpg)
    # ...

    image_format = b'jpg'
    # ...

    tf_example = tf.train.Example(features=tf.train.Features(feature={
        'image/height': dataset_util.int64_feature(height),
        'image/width': dataset_util.int64_feature(width),
        'image/filename': dataset_util.bytes_feature(filename),
        'image/source_id': dataset_util.bytes_feature(filename),
        'image/encoded': dataset_util.bytes_feature(encoded_jpg),
        'image/format': dataset_util.bytes_feature(image_format),
        'image/object/bbox/xmin': dataset_util.float_list_feature(xmins),
        'image/object/bbox/xmax': dataset_util.float_list_feature(xmaxs),
        'image/object/bbox/ymin': dataset_util.float_list_feature(ymins),
        'image/object/bbox/ymax': dataset_util.float_list_feature(ymaxs),
        'image/object/class/text': dataset_util.bytes_list_feature(classes_text),
        'image/object/class/label': dataset_util.int64_list_feature(classes),
    }))

上記の形式で tfrecord を正常に保存しました。ここで、encoded_jpg は dicom ファイルの numpy 配列のバイト文字列です。

  1. ただし、image_format を設定する方法と、これが必要かどうか、どこに文書化されているかを自問します。
  2. さらに、一般的に、tensorflow objection api を dicom ファイルで使用できるかどうか、または tensorflow オブジェクト検出 api が jpg に制限されているかどうかを知りたいです。

@ j2abro dicom 画像を jpeg に変換しないように明示したいのは、理解できる限り jpeg はピクセルあたり 8 ビットであり、私の dicom ファイルはピクセルあたり 12 ビットであるためです。ロスレス バージョンのデータを使用したい。

4

1 に答える 1