Пример #1
0
    def test_feature(self):

        self.assertFeature(
            feature=features.BBoxFeature(),
            shape=(4, ),
            dtype=tf.float32,
            tests=[
                # Numpy array
                testing.FeatureExpectationItem(
                    value=features.BBox(
                        ymin=0.0,
                        xmin=0.25,
                        ymax=1.0,
                        xmax=0.75,
                    ),
                    expected=[0.0, 0.25, 1.0, 0.75],
                ),
            ],
        )
Пример #2
0
    def expectations(self):

        return [
            test_utils.FeatureExpectation(
                name='bbox',
                feature=features.BBoxFeature(),
                shape=(4, ),
                dtype=tf.float32,
                tests=[
                    # Numpy array
                    test_utils.FeatureExpectationItem(
                        value=features.BBox(
                            ymin=0.0,
                            xmin=0.25,
                            ymax=1.0,
                            xmax=0.75,
                        ),
                        expected=[0.0, 0.25, 1.0, 0.75],
                    ),
                ],
            ),
        ]