Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -320,8 +320,9 @@ class GPUSatelliteModelGenerator:
|
|
| 320 |
def generate_uvs_gpu(vertices, width, height):
|
| 321 |
"""Generate optimized UV coordinates"""
|
| 322 |
uvs = cp.zeros((vertices.shape[0], 2), order='C')
|
| 323 |
-
|
| 324 |
-
uvs[:,
|
|
|
|
| 325 |
return uvs
|
| 326 |
|
| 327 |
@staticmethod
|
|
|
|
| 320 |
def generate_uvs_gpu(vertices, width, height):
|
| 321 |
"""Generate optimized UV coordinates"""
|
| 322 |
uvs = cp.zeros((vertices.shape[0], 2), order='C')
|
| 323 |
+
# Fix: Use width-1 and height-1 for proper UV scaling, and swap coordinates
|
| 324 |
+
uvs[:, 0] = vertices[:, 0] * width / ((width - 1) * 2) + 0.5 # Scale and center X coordinate
|
| 325 |
+
uvs[:, 1] = 1 - (vertices[:, 2] * height / ((height - 1) * 2) + 0.5) # Scale, flip and center Y coordinate
|
| 326 |
return uvs
|
| 327 |
|
| 328 |
@staticmethod
|