Sağlanan kod parçası, bir görüntüdeki web varlıklarını ("gizemli parçaları") tespit etmek için Google Cloud Vision API kullanan bir Python örneğidir:
from __future__ import print_function
from google.cloud.vision import ImageAnnotatorClient
import io, os
def get_mystery_part(path):
client = ImageAnnotatorClient()
with io.open(path, 'rb') as f:
content = f.read()
image = types.Image(content=content)
response = client.web_detection(image)
for label in response.web_detection.best_guess_labels:
print("Mystery: {}".format(label.label))
Bu bir oyun hile kodu değil; resimlerde nesne veya varlık tespiti yapan bir AI görüntü analiz betiğidir.