Open Yellowshuohahaha opened 1 year ago
Hi, thanks for your outstanding work. Could you tell me how to use the pretrained model to predict the color of point clouds? I used the following code, but the result is really bad and the rgb value is close to 0.
transform = transforms.Compose([ transforms.ToPILImage(), transforms.Resize((128, 128)), transforms.ToTensor(), ]) train_dataset = ImgtoPointDataset(root="./data/pointcloud_point", transform=transform) train_loader = DataLoader(train_dataset, batch_size=1, shuffle=True, num_workers=16) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') G = Net(3) G.cuda() G.load_state_dict(torch.load("./generator_bestloss.pth", map_location='cpu')) G.eval() for i, batch in enumerate(train_loader): rgb = batch[0].numpy() point = batch[1].float().numpy() geom = batch[2] geom = geom.to(device) fakergb = G(geom) fakergb = fakergb.cpu().detach().numpy() rgb = np.squeeze(rgb) point = np.squeeze(point) pointrealcolor = np.concatenate([point, rgb], axis=1) pointfakecolor = np.concatenate([point, fakergb], axis=1) np.savetxt("./predict/%d_pointrealcolor.txt" % (i), pointrealcolor) np.savetxt("./predict/%d_pointfakecolor.txt"%(i), pointfakecolor)
Hi, were you able to fix this?
Hi, thanks for your outstanding work. Could you tell me how to use the pretrained model to predict the color of point clouds? I used the following code, but the result is really bad and the rgb value is close to 0.
transform = transforms.Compose([ transforms.ToPILImage(), transforms.Resize((128, 128)), transforms.ToTensor(), ]) train_dataset = ImgtoPointDataset(root="./data/pointcloud_point", transform=transform) train_loader = DataLoader(train_dataset, batch_size=1, shuffle=True, num_workers=16) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') G = Net(3) G.cuda() G.load_state_dict(torch.load("./generator_bestloss.pth", map_location='cpu')) G.eval() for i, batch in enumerate(train_loader): rgb = batch[0].numpy() point = batch[1].float().numpy() geom = batch[2] geom = geom.to(device) fakergb = G(geom) fakergb = fakergb.cpu().detach().numpy() rgb = np.squeeze(rgb) point = np.squeeze(point) pointrealcolor = np.concatenate([point, rgb], axis=1) pointfakecolor = np.concatenate([point, fakergb], axis=1) np.savetxt("./predict/%d_pointrealcolor.txt" % (i), pointrealcolor) np.savetxt("./predict/%d_pointfakecolor.txt"%(i), pointfakecolor)
Hi, were you able to fix this?
No, I'm still confused about this. Did you meet same problem?
Yes, facing the same problem
@shnhrtkyk Hi, can you help us?
Have you trained on the 10 las files supplied? Because that's just a tiny fraction of the real data...
Hi, thanks for your outstanding work. Could you tell me how to use the pretrained model to predict the color of point clouds? I used the following code, but the result is really bad and the rgb value is close to 0.