Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion people-and-planet-ai/image-classification/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from google.cloud.aiplatform.gapic.schema import predict
import requests

from train_model import with_retries


def run(
project: str, region: str, model_endpoint_id: str, image_file: str
Expand All @@ -43,7 +45,7 @@ def run(
)

base_url = "https://lilablobssc.blob.core.windows.net/wcs-unzipped"
image_bytes = requests.get(f"{base_url}/{image_file}").content
image_bytes = with_retries(lambda: requests.get(f"{base_url}/{image_file}").content)

response = client.predict(
endpoint=client.endpoint_path(
Expand Down