lfz / DSB2017

The solution of team 'grt123' in DSB2017
MIT License
1.24k stars 418 forks source link

Something wrong with the features exporting #7

Open paulcx opened 7 years ago

paulcx commented 7 years ago

end preprocessing (18L, 1L, 208L, 208L, 208L) Traceback (most recent call last): File "main.py", line 62, in test_detect(test_loader, nod_net, get_pbb, bbox_result_path,config1,n_gpu=config_submit['n_gpu']) File "/home/xx/py/DSB2017-master/test_detect.py", line 55, in test_detect output = split_comber.combine(output,nzhw=nzhw) File "/home/xx/py/DSB2017-master/split_combine.py", line 83, in combine splits[0].shape[4]), np.float32) IndexError: tuple index out of range

I'm wondering if the codes: _if 'output_feature' in config: if config['outputfeature']: isfeat = True are used for exporting the features. If not, how can I review the features or proposals detected by the model?

lfz commented 7 years ago

config['output_feature'] is a deprecated configuration

I'm not sure about your problem, please give more info?

paulcx commented 7 years ago

Would be possible to export/save the features and nodule detection results (ROIs maybe)?

paulcx commented 7 years ago

Hi @lfz Is there a way we can simply export the bboxes coordinates and visualize them while testing the detection?

lfz commented 7 years ago

load the pbb, nms it, and you can get the coordinate, see data_classifier

paulcx commented 7 years ago

@lfz Thank you. According to the data_classifier,

      for idx in idcs:
        pbb = np.load(os.path.join(bboxpath,idx+'_pbb.npy'))
        pbb = pbb[pbb[:,0]>config['conf_th']]
        pbb = nms(pbb, config['nms_th'])
        print('bboxes: ',pbb.shape)
        lbb = np.load(os.path.join(bboxpath,idx+'_lbb.npy'))
        pbb_label = []

      for p in pbb:
            isnod = False
            for l in lbb:
                score = iou(p[1:5], l)
                if score > config['detect_th']:
                    isnod = True
                    break
            pbb_label.append(isnod)

        self.candidate_box.append(pbb)
        self.pbb_label.append(np.array(pbb_label))
    self.crop = simpleCrop(config,phase)

How can I visualize the bounding boxes based on the specific slice of the CT scan? That requires the 3D location of a scan?