W-Ted / GScream

Official code for ECCV2024 paper: GScream: Learning 3D Geometry and Feature Consistent Gaussian Splatting for Object Removal
60 stars 4 forks source link

how to visualize your reconstructed gaussian #8

Open wangmiaowei opened 2 weeks ago

wangmiaowei commented 2 weeks ago
    anchor = self._anchor.detach().cpu().numpy()
    normals = np.zeros_like(anchor)
    anchor_feat = self._anchor_feat.detach().cpu().numpy()
    offset = self._offset.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
    opacities = self._opacity.detach().cpu().numpy()
    uncertainties = self._uncertainty.detach().cpu().numpy()
    scale = self._scaling.detach().cpu().numpy()
    rotation = self._rotation.detach().cpu().numpy()

    dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes()]

    elements = np.empty(anchor.shape[0], dtype=dtype_full)
    # attributes = np.concatenate((anchor, normals, offset, anchor_feat, opacities, scale, rotation), axis=1)
    attributes = np.concatenate((anchor, normals, offset, anchor_feat, opacities, uncertainties, scale, rotation), axis=1)
    elements[:] = list(map(tuple, attributes))
    el = PlyElement.describe(elements, 'vertex')
    PlyData([el]).write(path)

Thanks for your work, but I do not how to visualize the gaussian in such format

W-Ted commented 2 weeks ago

Hi @wangmiaowei, our GS component is based on Scaffold-GS. You may refer to the viewer they provided here: https://github.com/city-super/Scaffold-GS/tree/main/SIBR_viewers.