Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -69,7 +69,7 @@ def detect_and_crop_street(panorama_url, use_yolo=True):
|
|
| 69 |
|
| 70 |
midx = (x2 - x1) / 2
|
| 71 |
# Add some padding
|
| 72 |
-
padding =
|
| 73 |
height, width = cv_img.shape[:2]
|
| 74 |
x1 = max(0, x1 - padding)
|
| 75 |
y1 = max(0, y1 - padding)
|
|
@@ -295,11 +295,11 @@ def main():
|
|
| 295 |
st.write('Processing panoramic image')
|
| 296 |
image = process_panorama(image_data['thumb_1024_url'])
|
| 297 |
image_bytes = BytesIO()
|
| 298 |
-
st.write('Resaving image size =', image.size, ' image format = ', image.format)
|
| 299 |
image.save(image_bytes, format='JPEG')
|
| 300 |
image = Image.open(image_bytes)
|
| 301 |
image_bytes = image_bytes.getvalue()
|
| 302 |
-
st.write('Panoramic image size = ', image.size, ' format = ', image.format)
|
| 303 |
else:
|
| 304 |
response = requests.get(image_data['thumb_1024_url'])
|
| 305 |
image = Image.open(BytesIO(response.content))
|
|
|
|
| 69 |
|
| 70 |
midx = (x2 - x1) / 2
|
| 71 |
# Add some padding
|
| 72 |
+
padding = 100
|
| 73 |
height, width = cv_img.shape[:2]
|
| 74 |
x1 = max(0, x1 - padding)
|
| 75 |
y1 = max(0, y1 - padding)
|
|
|
|
| 295 |
st.write('Processing panoramic image')
|
| 296 |
image = process_panorama(image_data['thumb_1024_url'])
|
| 297 |
image_bytes = BytesIO()
|
| 298 |
+
#st.write('Resaving image size =', image.size, ' image format = ', image.format)
|
| 299 |
image.save(image_bytes, format='JPEG')
|
| 300 |
image = Image.open(image_bytes)
|
| 301 |
image_bytes = image_bytes.getvalue()
|
| 302 |
+
#st.write('Panoramic image size = ', image.size, ' format = ', image.format)
|
| 303 |
else:
|
| 304 |
response = requests.get(image_data['thumb_1024_url'])
|
| 305 |
image = Image.open(BytesIO(response.content))
|