Update app.py
Browse files
app.py
CHANGED
|
@@ -146,6 +146,7 @@ with tempfile.TemporaryDirectory() as tmpdir:
|
|
| 146 |
print(f"Switched to GenStereo {sd_version_choice}. IMAGE_SIZE: {IMAGE_SIZE}, CHECKPOINT: {CHECKPOINT_NAME}")
|
| 147 |
return None, None, None, None, None, None
|
| 148 |
|
|
|
|
| 149 |
def cb_mde(image_file: str, sd_version):
|
| 150 |
if not image_file:
|
| 151 |
# Return None if no image is provided (e.g., when file is cleared).
|
|
@@ -171,6 +172,7 @@ with tempfile.TemporaryDirectory() as tmpdir:
|
|
| 171 |
|
| 172 |
return image, depth_image, image, depth
|
| 173 |
|
|
|
|
| 174 |
def cb_generate(image, depth: Tensor, scale_factor, sd_version):
|
| 175 |
norm_disp = normalize_disp(depth.cuda())
|
| 176 |
disp = norm_disp * scale_factor / 100 * IMAGE_SIZE
|
|
|
|
| 146 |
print(f"Switched to GenStereo {sd_version_choice}. IMAGE_SIZE: {IMAGE_SIZE}, CHECKPOINT: {CHECKPOINT_NAME}")
|
| 147 |
return None, None, None, None, None, None
|
| 148 |
|
| 149 |
+
@spaces.GPU()
|
| 150 |
def cb_mde(image_file: str, sd_version):
|
| 151 |
if not image_file:
|
| 152 |
# Return None if no image is provided (e.g., when file is cleared).
|
|
|
|
| 172 |
|
| 173 |
return image, depth_image, image, depth
|
| 174 |
|
| 175 |
+
@spaces.GPU()
|
| 176 |
def cb_generate(image, depth: Tensor, scale_factor, sd_version):
|
| 177 |
norm_disp = normalize_disp(depth.cuda())
|
| 178 |
disp = norm_disp * scale_factor / 100 * IMAGE_SIZE
|