Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Bug in data_classes?

未关闭
#85 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
numpy, python

调研方向

从 data_classes.py 中 LidarPointCloud 和 PointCloud 的实现开始,然后检查 scene 21 的 .bin 文件是如何加载的。将 reshape 的假设与针对长度不能被五整除的文件所提供的替代处理方式进行比较。完成标准是:受影响的文件能够以正确的点云值加载,同时不破坏现有格式。

由索引模型根据 Issue 内容生成。

描述

I believe that there is a small flaw in the data_classes.py file in the LidarPointCloud class (PointCloud). Because not all files that I tried to get have the same format for the reshape ((- - 1, 5)) [:,: cls.nbr_dims ()], that is, points = scan.reshape ((- -, 5) ) [:,: cls.nbr_dims ()]. I encountered such a problem in scene 21.
So, I replaced the LidarPointCloud (PointCloud) class with:

class LidarPointCloud(PointCloud):
@staticmethod
def nbr_dims() -> int:
    """Returns the number of dimensions.

    Returns: Number of dimensions.

    """
    return 4

@classmethod
def from_file(cls, file_name: Path) -> "LidarPointCloud":
    """Loads LIDAR data from binary numpy format. Data is stored as (x, y, z, intensity, ring index).

    Args:
        file_name: Path of the pointcloud file on disk.

    Returns: LidarPointCloud instance (x, y, z, intensity).

    """

    assert file_name.suffix == ".bin", "Unsupported filetype {}".format(file_name)

    scan = np.fromfile(str(file_name), dtype=np.float32)
    if len(scan) % 5 == 0:
        points = scan.reshape((-1, 5))[:, : cls.nbr_dims()]
    else:
        scan0=[]
        scan1=[]
        scan2=[]
        scan3=[]
        scan4=[]
        scan_pontos = []
        scan_pontos = scan.reshape((-1, 1))
        dv = 0
        for divisao in range(math.floor(len(scan)/5)):
            if (dv+4)<=len(scan):
                scan0.append(scan_pontos[dv])
                scan1.append(scan_pontos[dv+1])
                scan2.append(scan_pontos[dv+2])
                scan3.append(scan_pontos[dv+3])
                scan4.append(scan_pontos[dv+4])
            dv = dv+5
        points = np.concatenate((scan0,scan1,scan2,scan3),axis=1)
    return cls(points.T)

I I believe that now I got the correct point cloud values.

主要语言
Jupyter Notebook
星标
390
派生
99
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

lyft/nuscenes-devkit 的其他 Issue

查看 lyft/nuscenes-devkit 的全部 Issue

相似的 Issue

更多 Computer Vision Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。