def test_crop_generator_build_input_graph(crop_generator):
    crop_generator.build_input_graph()
    assert crop_generator.input_variables["image_ph"].get_shape().as_list(
    ) == [
        None, crop_generator.config["train"]["dset"]["height"],
        crop_generator.config["train"]["dset"]["width"],
        len(crop_generator.config["dataset"]["images"]["channels"])
    ]
    assert crop_generator.input_variables["boxes_ph"].get_shape().as_list(
    ) == [None, 4]
    assert crop_generator.input_variables["box_ind_ph"].get_shape().as_list(
    ) == [None]
    assert len(crop_generator.input_variables["targets_phs"]) == len(
        crop_generator.dset.targets)
    assert crop_generator.input_variables["mask_ind_ph"].get_shape().as_list(
    ) == [None]
    assert len(crop_generator.input_variables["labeled_crops"]) == 1 + len(
        crop_generator.dset.targets)
    assert crop_generator.input_variables["labeled_crops"][0].get_shape(
    ).as_list() == [
        None, crop_generator.config["train"]["sampling"]["box_size"],
        crop_generator.config["train"]["sampling"]["box_size"],
        len(crop_generator.config["dataset"]["images"]["channels"])
    ]
    for target in crop_generator.input_variables["labeled_crops"][1:]:
        assert target.get_shape().as_list() == [None]
Exemple #2
0
def test_crop_generator_build_input_graph(crop_generator):
    crop_generator.build_input_graph()
    assert crop_generator.input_variables['image_ph'].get_shape().as_list(
    ) == [
        None, crop_generator.config['image_set']['height'],
        crop_generator.config['image_set']['width'],
        len(crop_generator.config['image_set']['channels'])
    ]
    assert crop_generator.input_variables['boxes_ph'].get_shape().as_list(
    ) == [None, 4]
    assert crop_generator.input_variables['box_ind_ph'].get_shape().as_list(
    ) == [None]
    assert len(crop_generator.input_variables['targets_phs']) == len(
        crop_generator.dset.targets)
    assert crop_generator.input_variables['mask_ind_ph'].get_shape().as_list(
    ) == [None]
    assert len(crop_generator.input_variables['labeled_crops']) == 1 + len(
        crop_generator.dset.targets)
    assert crop_generator.input_variables['labeled_crops'][0].get_shape(
    ).as_list() == [
        None, crop_generator.config['sampling']['box_size'],
        crop_generator.config['sampling']['box_size'],
        len(crop_generator.config['image_set']['channels'])
    ]
    for target in crop_generator.input_variables['labeled_crops'][1:]:
        assert target.get_shape().as_list() == [None]