关于非 jpeg 的 TensorFlow 对象检测 api 和图像/格式的问题例如 dicom 或 numpy 数组

问题描述

我喜欢将 tensorflow 中的对象检测 api 与 dicom 图像而不是 jpg 一起使用。

在文档中: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records 我找到以下代码

import usersjson from './jsons/users.json';

async function updateUsers() {
    
    const promises = [];

    const users = usersjson;
    for( const user of users ) {
        const promise = updateUser( user ); // <-- Note this is *NOT* awaited here.
        promises.push( promise );
    }

    await Promise.all( promises ); // <-- This is where we await everything.
}

async function updateUser( user ) {
    
    try {
        const data = await getUser( url,user.Id,'Id' );
        if( data.users.length === 0 ) {
            let createResult = await newUser( url,user );
            console.log( "Created new user %o",createResult  );
        }
        else {
            const updateResult = await updateUser( url,user,data.users[0].id );
            console.log( "Update user %o: Result: %o",updateResult );
        }
    }
    catch( err ) {
        console.error( "Failed to update (or create) user with UserId %o: %o",user.userId,err );
    }
}


我已经成功地用上述格式保存了一个 tfrecord,其中 encoding_jpg 是 dicom 文件的 numpy 数组的字节串。

  1. 不过,我问自己如何设置 image_format 以及是否需要以及在何处记录?
  2. 此外,我想知道通常是否可以将 tensorflow object detection api 与 dicom 文件一起使用,或者 tensorflow object detection api 是否仅限于 jpg。

@j2abro 我不想明确地将我的 dicom 图像转换为 jpeg,因为据了解,jpeg 每像素 8 位,而我的 dicom 文件每像素 12 位。我想使用我的数据的无损版本。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)