luh1124 commited on
Commit
2b829a1
·
1 Parent(s): 1ec3c4e

fix(gsplat): 2DGS image fit — expand colors to [1,N,3] for packed=False

Browse files
Files changed (1) hide show
  1. app_gsplat.py +4 -0
app_gsplat.py CHANGED
@@ -155,6 +155,10 @@ class SimpleImageFitter:
155
  quats_n = quats / quats.norm(dim=-1, keepdim=True)
156
  op = torch.sigmoid(opacities)
157
  colors = torch.sigmoid(rgbs)
 
 
 
 
158
  out = rasterize_fnc(
159
  means,
160
  quats_n,
 
155
  quats_n = quats / quats.norm(dim=-1, keepdim=True)
156
  op = torch.sigmoid(opacities)
157
  colors = torch.sigmoid(rgbs)
158
+ # 2DGS packed=False: colors must be [..., C, N, D] to match projected means2d
159
+ # (same leading dims as viewmats batch). Plain [N, D] hits assert in rasterize_to_pixels_2dgs.
160
+ if rasterize_fnc.__name__ == "rasterization_2dgs" and colors.dim() == 2:
161
+ colors = colors.unsqueeze(0)
162
  out = rasterize_fnc(
163
  means,
164
  quats_n,