from google.cloud import storage import cv2 import tempfile # Initialize Cloud Storage client storage_client = storage.Client() bucket_name = "your-bucket-name" blob_name = "path/to/image.jpg" # Download to a temporary file bucket = storage_client.bucket(bucket_name) blob = bucket.blob(blob_name) with tempfile.NamedTemporaryFile(delete=True, suffix=".jpg") as temp_file: blob.download_to_filename(temp_file.name) # Read the image with cv2 image = cv2.imread(temp_file.name) # Display or process the image cv2.imshow("Image", image) cv2.waitKey(0) cv2.destroyAllWindows()