Spaces:
Runtime error
Runtime error
Update generator.py
Browse files- generator.py +3 -2
generator.py
CHANGED
|
@@ -153,8 +153,9 @@ class RetroArtConverter:
|
|
| 153 |
if image.mode != 'RGB':
|
| 154 |
image = image.convert('RGB')
|
| 155 |
|
| 156 |
-
# ZoeDetector
|
| 157 |
-
|
|
|
|
| 158 |
|
| 159 |
# Use .width and .height properties (always Python ints, not numpy types)
|
| 160 |
print(f"[DEPTH] Zoe depth map generated: {image.width}x{image.height}")
|
|
|
|
| 153 |
if image.mode != 'RGB':
|
| 154 |
image = image.convert('RGB')
|
| 155 |
|
| 156 |
+
# CRITICAL: ZoeDetector must be called with torch.no_grad()
|
| 157 |
+
with torch.no_grad():
|
| 158 |
+
depth_image = self.zoe_depth(image)
|
| 159 |
|
| 160 |
# Use .width and .height properties (always Python ints, not numpy types)
|
| 161 |
print(f"[DEPTH] Zoe depth map generated: {image.width}x{image.height}")
|