Open github-actions[bot] opened 7 months ago
println!("initial cloud size: {}", cloud.len());
cloud \= (0..cloud.len())
.filter(|&idx| {
is_point_in_transformed_sphere(
cloud.position(idx),
)
})
.map(|idx| cloud.gaussian(idx))
.collect();
println!("filtered position cloud size: {}", cloud.len());
https://github.com/mosure/bevy_gaussian_splatting/blob/507a28dda771518415d762f85db7607ea60bfbe8/tools/ply_to_gcloud.rs#L48
let file = std::fs::File::open(&filename).expect("failed to open file"); let mut reader = std::io::BufReader::new(file); let mut cloud = GaussianCloud::from_gaussians( parse_ply(&mut reader).expect("failed to parse ply file"), ); // TODO: prioritize mesh selection over export filter // println!("initial cloud size: {}", cloud.len()); // cloud = (0..cloud.len()) // .filter(|&idx| { // is_point_in_transformed_sphere( // cloud.position(idx), // ) // }) // .map(|idx| cloud.gaussian(idx)) // .collect(); // println!("filtered position cloud size: {}", cloud.len()); #[cfg(feature = "query_sparse")] { let sparse_selection = SparseSelect::default().select(&cloud).invert(cloud.len()); cloud = sparse_selection.indicies.iter() .map(|idx| cloud.gaussian(*idx)) .collect(); println!("sparsity filtered cloud size: {}", cloud.len()); } let base_filename = filename.split('.').next().expect("no extension").to_string(); let gcloud_filename = base_filename + ".gcloud"; write_gaussian_cloud_to_file(&cloud, &gcloud_filename); let post_encode_bytes = Byte::from_u64(std::fs::metadata(&gcloud_filename).expect("failed to get metadata").len()); println!("output file size: {}", post_encode_bytes.get_appropriate_unit(UnitType::Decimal)); }
println!("initial cloud size: {}", cloud.len());
cloud \= (0..cloud.len())
.filter(|&idx| {
is_point_in_transformed_sphere(
cloud.position(idx),
)
})
.map(|idx| cloud.gaussian(idx))
.collect();
println!("filtered position cloud size: {}", cloud.len());
https://github.com/mosure/bevy_gaussian_splatting/blob/507a28dda771518415d762f85db7607ea60bfbe8/tools/ply_to_gcloud.rs#L48