コード例 #1
0
def main(_):
    roi_images = tf.placeholder(shape=[
        net_config.BATCH_SIZE, net_config.ROI_SIZE_W, net_config.ROI_SIZE_H,
        net_config.IMAGE_CHANNEL
    ],
                                dtype=np.float32,
                                name='roi_input')
    expand_roi_images = tf.placeholder(shape=[
        net_config.BATCH_SIZE, net_config.EXPAND_SIZE_W,
        net_config.EXPAND_SIZE_H, net_config.IMAGE_CHANNEL
    ],
                                       dtype=np.float32,
                                       name='expand_roi_input')
    labels_tensor = tf.placeholder(shape=[None], dtype=np.int32)
    is_training_tensor = tf.placeholder(dtype=tf.bool, shape=[])
    logits = inference_small(roi_images,
                             expand_roi_images,
                             phase_names=['NC', 'ART', 'PV'],
                             num_classes=4,
                             is_training=is_training_tensor)
    save_model_path = '/home/give/PycharmProjects/MedicalImage/Net/forpatch/ResNetMultiPhaseMultiScale/model/parallel'
    train(logits,
          roi_images,
          expand_roi_images,
          labels_tensor,
          is_training_tensor,
          save_model_path=save_model_path,
          step_width=100)
コード例 #2
0
def main(_):
    roi_images = tf.placeholder(shape=[
        net_config.BATCH_SIZE, net_config.ROI_SIZE_W, net_config.ROI_SIZE_H,
        net_config.IMAGE_CHANNEL
    ],
                                dtype=np.float32,
                                name='roi_input')
    expand_roi_images = tf.placeholder(shape=[
        net_config.BATCH_SIZE, net_config.EXPAND_SIZE_W,
        net_config.EXPAND_SIZE_H, net_config.IMAGE_CHANNEL
    ],
                                       dtype=np.float32,
                                       name='expand_roi_input')
    labels_tensor = tf.placeholder(shape=[None], dtype=np.int32)
    is_training_tensor = tf.placeholder(dtype=tf.bool, shape=[])
    logits = inference_small(roi_images,
                             expand_roi_images,
                             phase_names=['NC', 'ART', 'PV'],
                             num_classes=4,
                             is_training=is_training_tensor,
                             point_phase=[2])
    save_model_path = '/home/give/PycharmProjects/ICPR2018/DeepLearning/Patch_ROI/models'
    train(logits,
          roi_images,
          expand_roi_images,
          labels_tensor,
          is_training_tensor,
          save_model_path=save_model_path,
          step_width=20,
          record_loss=False)
コード例 #3
0
def main(_):
    roi_images = tf.placeholder(shape=[
        net_config.BATCH_SIZE, net_config.ROI_SIZE_W, net_config.ROI_SIZE_H,
        net_config.IMAGE_CHANNEL
    ],
                                dtype=np.float32,
                                name='roi_input')
    expand_roi_images = tf.placeholder(shape=[
        net_config.BATCH_SIZE, net_config.EXPAND_SIZE_W,
        net_config.EXPAND_SIZE_H, net_config.IMAGE_CHANNEL
    ],
                                       dtype=np.float32,
                                       name='expand_roi_input')
    labels_tensor = tf.placeholder(shape=[None], dtype=np.int32)
    is_training_tensor = tf.placeholder(dtype=tf.bool, shape=[])
    logits, local_output_tensor, global_output_tensor, represent_feature_tensor = inference_small(
        roi_images,
        expand_roi_images,
        phase_names=['NC', 'ART', 'PV'],
        num_classes=4,
        is_training=is_training_tensor)
    save_model_path = '/home/give/PycharmProjects/MICCAI2018/deeplearning/Co-Occurrence/parameters/1'
    train(logits,
          local_output_tensor,
          global_output_tensor,
          represent_feature_tensor,
          roi_images,
          expand_roi_images,
          labels_tensor,
          is_training_tensor,
          save_model_path=save_model_path,
          step_width=100)