Пример #1
0
                             mode='test')
    genVal = DataGenerator(imagesMeta=data.valGTMeta,
                           cfg=cfg,
                           data_type='val',
                           do_meta=True,
                           mode='test')
    #    genTest = DataGenerator(imagesMeta = data.testGTMeta, cfg=cfg, data_type='test', do_meta=True)

    Models = methods.AllModels(cfg,
                               mode='test',
                               do_rpn=False,
                               do_det=True,
                               do_hoi=False)
    Stages = stages.AllStages(cfg,
                              Models,
                              obj_mapping,
                              hoi_mapping,
                              mode='test')

# Val data
evalVal = det_test.saveEvalData(genVal, Stages, cfg, obj_mapping)
det_test.saveEvalResults(genVal, cfg)

# Test data
#evalTest = det_test.saveEvalData(genTest, Stages, cfg, obj_mapping)
#det_test.saveEvalResults(evalTest, genTest, cfg)

# Train data
#evalTrain = det_test.saveEvalData(genTrain, Stages, cfg, obj_mapping)
#det_test.saveEvalResults(evalTrain, genTrain, cfg)
Пример #2
0
data = extract_data.object_data(False)

# config
cfg = data.cfg
#cfg.do_fast_hoi = True
obj_mapping = data.class_mapping
hoi_mapping = data.hoi_labels

# data
genTrain = DataGenerator(imagesMeta=data.trainGTMeta,
                         cfg=cfg,
                         data_type='train',
                         do_meta=True)
#genTest = DataGenerator(imagesMeta = data.valGTMeta, cfg=cfg, data_type='test', do_meta=True, mode='test', approach='new')

Stages = stages.AllStages(cfg, None, obj_mapping, hoi_mapping, mode='test')
#imageID = 'HICO_test2015_00005579'
#imageMeta = genTest.imagesMeta[imageID]
#X, y, imageDims = Stages.stagezero(imageMeta, genTest.data_type)
#imageInputs = utils.load_obj(cfg.my_input_path + 'testnewest/' + imageID)
#Y_tmp = filters_hoi.loadData(imageInputs, imageDims, cfg)
#[hbboxes, obboxes, target_labels, all_val_map] = Y_tmp
#hbboxes, obboxes, target_labels, val_map = filters_hoi.reduceTargets(Y_tmp, cfg)
#patterns = filters_hoi.createInteractionPatterns(hbboxes, obboxes, cfg)
#hcrops, ocrops = filters_hoi.convertBB2Crop(X, hbboxes, obboxes, imageDims)

#Models = methods.AllModels(cfg, mode='test', do_rpn=True, do_det=True, do_hoi=False)
#cfg.det_nms_overlap_thresh = 0.5
#Stages = stages.AllStages(cfg, Models, obj_mapping, hoi_mapping, mode='train')
#
##STAGE 0
Пример #3
0
    genVal = DataGenerator(imagesMeta=data.valGTMeta,
                           cfg=cfg,
                           data_type='test',
                           do_meta=True,
                           mode='test')
    #    genTest = DataGenerator(imagesMeta = data.valGTMeta, cfg=cfg, data_type='test', do_meta=True, mode='test')

    #if False:
    Models = methods.AllModels(cfg,
                               mode='test',
                               do_rpn=True,
                               do_det=True,
                               do_hoi=True)
Stages = stages.AllStages(cfg,
                          Models,
                          obj_mapping,
                          hoi_mapping,
                          mode='test',
                          return_times=True)

generator = genVal
genIterator = generator.begin()

nb_iterations = 1
all_times = np.zeros((nb_iterations, 5))

for i in range(nb_iterations):
    X, y, imageMeta, imageDims, times = next(genIterator)

    #    imageID = 'Play_Saxophone_007'
    #    imageMeta = generator.imagesMeta[imageID]
    #    X, y, imageDims = Stages.stagezero(imageMeta, generator.data_type)
Пример #4
0
    data = extract_data.object_data()
    cfg = data.cfg
    obj_mapping = data.class_mapping
    hoi_mapping = data.hoi_labels    
    
#     Create batch generators
    genTrain = DataGenerator(imagesMeta = data.trainGTMeta, cfg=cfg, data_type='train', do_meta=True)
    genTest = DataGenerator(imagesMeta = data.valGTMeta, cfg=cfg, data_type='test', do_meta=True)
    
    Models = methods.AllModels(cfg, mode='test', do_rpn=True, do_det=True, do_hoi=False)

    sys.stdout.flush()

if True:
    cfg.det_nms_overlap_thresh = 0.5
    Stages = stages.AllStages(cfg, Models, obj_mapping, hoi_mapping, mode='train')
    imageInputs, imageID, bboxes = hoi_test.saveInputData(genTest, Stages, cfg)
    cfg.det_nms_overlap_thresh = 0.9
    Stages = stages.AllStages(cfg, Models, obj_mapping, hoi_mapping, mode='train')
    imageInputs, imageID, bboxes = hoi_test.saveInputData(genTrain, Stages, cfg)
#    cfg.det_nms_overlap_thresh = 0.5
#    Stages = stages.AllStages(cfg, Models, obj_mapping, hoi_mapping, mode='train')
#    imageInputs, imageID, bboxes = hoi_test.saveInputData(genTrain, Stages, cfg, do_train_eval=True)




if False:
#    imageID = 'HICO_train2015_00025124'
    imageInputs = utils.load_obj(cfg.my_output_path + imageID)
#    keys = list(inputMeta.keys())