kangpeilun / VastGaussian

This is an unofficial Implementation
Apache License 2.0
327 stars 26 forks source link

Wrong platform name in train_vast example #21

Closed k73kondrashov closed 3 months ago

k73kondrashov commented 3 months ago

Hello! Thanks for the great job. I want to inform you that I found an error in your code (or README). In the README you give an example

python train_vast.py -s datasets/xxx --exp_name xxx --manhattan --plantform threejs --pos "xx xx xx" --rot "xx xx xx"

But in get_man_trans function, the platform name is assumed to be different. Therefore, this function returns None and the point cloud does not transform correctly.

def get_man_trans(lp):
    lp.pos = [float(pos) for pos in lp.pos.split(" ")]
    lp.rot = [float(rot) for rot in lp.rot.split(" ")]

    man_trans = None
    if lp.manhattan and lp.plantform == "tj":  # threejs
        man_trans = create_man_rans(lp.pos, lp.rot)
        lp.man_trans = man_trans
    elif lp.manhattan and lp.plantform == "cc":  # cloudcompare 如果处理平台为cloudcompare,则rot为旋转矩阵
        rot = np.array(lp.rot).reshape([3, 3])
        man_trans = np.zeros((4, 4))
        man_trans[:3, :3] = rot
        man_trans[:3, -1] = np.array(lp.pos)
        man_trans[3, 3] = 1

    return man_trans

For example, you can raise an error in this function if the platform name does not match anything

...
else:
    raise ValueError(f"Incorrect platform name")
FairySunny commented 3 months ago

The word platform is misspelled as plantform, although this does not affect the functionality

kangpeilun commented 3 months ago

Sorry, I've corrected the README description to use cc or tj instead