Spaces:
Build error
Build error
Commit ·
355aa9e
1
Parent(s): 357e1a3
Update model.py
Browse files11 unmodified lines12131415161719 unmodified lines373839404142434414 unmodified lines596061626364656611 unmodified linesfrom PIL import Imagefrom creds import get_credentialsdef generate_download_signed_url_v4(blob_name):19 unmodified lines# print("Generated GET signed URL:")# print(url)# print("You can use this URL with any user agent, for example:")# print(f"curl '{url}'")return url14 unmodified linesurl = task["data"]["image"]r = requests.get(generate_download_signed_url_v4(url), stream=True).rawimage = Image.open(r)original_width, original_height = image.sizewith torch.no_grad():11 unmodified lines1213141516171819 unmodified lines383940414243444514 unmodified lines60616263646566676811 unmodified linesfrom PIL import Imagefrom creds import get_credentialsfrom io import BytesIOdef generate_download_signed_url_v4(blob_name):19 unmodified lines# print("Generated GET signed URL:")# print(url)print("You can use this URL with any user agent, for example:")print(f"curl '{url}'")return url14 unmodified linesurl = task["data"]["image"]response = requests.get(generate_download_signed_url_v4(url))image_data = BytesIO(response.read())image = Image.open(image_data)original_width, original_height = image.sizewith torch.no_grad():
model.py+6-4