Skip to content

[Vision] add a new function 'detect_all' in image.py #3771

@bryanyang0528

Description

@bryanyang0528

There is a function detect in image.py for detecting multiple feature types. Could we add a function called detect_all to detect all feature types at one time? This is my proposal:

    def detect_all(self, limit=10):
        """Detect multiple feature types.

        :type limit: int
        :param limit: The number of faces to try and detect.

        :rtype: list
        :returns: List of
                  :class:`~google.cloud.vision.entity.EntityAnnotation`.
        """

        features = [Feature(x, limit) for x in FeatureTypes.__dict__.keys() if x[:1] != '_']
        annotations = self.detect(features)
        return annotations[0]

Metadata

Metadata

Labels

api: visionIssues related to the Cloud Vision API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions