jbilcke-hf HF staff commited on
Commit
d3574e6
·
verified ·
1 Parent(s): c446987

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- uvs[:, 0] = vertices[:, 0] / width
324
- uvs[:, 1] = 1 - (vertices[:, 2] / height)
 
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