diff --git a/data/__init__.py b/data/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000000..38e12241aa --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,41 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.starter + +#Enable inspections +#include: +# - name: + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +# Quality gate. Will fail the CI/CD pipeline if any condition is not met +# severityThresholds - configures maximum thresholds for different problem severities +# testCoverageThresholds - configures minimum code coverage on a whole project and newly added code +# Code Coverage is available in Ultimate and Ultimate Plus plans +#failureConditions: +# severityThresholds: +# any: 15 +# critical: 5 +# testCoverageThresholds: +# fresh: 70 +# total: 50 + +#Specify Qodana linter for analysis (Applied in CI/CD pipeline) +linter: jetbrains/qodana-:2025.2 diff --git a/src/Car_Perception_Automatic_Sensing/.gitignore b/src/Car_Perception_Automatic_Sensing/.gitignore new file mode 100644 index 0000000000..f3285da82c --- /dev/null +++ b/src/Car_Perception_Automatic_Sensing/.gitignore @@ -0,0 +1,30 @@ +# Python 相关 +__pycache__/ +*.pyc +*.pyo +*.pyd +.venv/ +env/ +*.env + +# PyCharm 相关 +.idea/ +*.iml +*.iws +*.ipr +out/ + +# 项目无关目录/文件 +../../.idea/ + +# 数据与模型(后续会用到) +data/raw/ +data/kitti/ +*.npy +*.pth +train/checkpoints/ +infer/results/ + +# OS 相关 +.DS_Store +Thumbs.db \ No newline at end of file diff --git a/src/Car_Perception_Automatic_Sensing/README.md b/src/Car_Perception_Automatic_Sensing/README.md index a93adc2a1c..7602125d1c 100644 --- a/src/Car_Perception_Automatic_Sensing/README.md +++ b/src/Car_Perception_Automatic_Sensing/README.md @@ -1,2 +1,28 @@ -无人车 无人车动态障碍物避障算法 无人车动态障碍物避障的核心目标是:在实时感知环境中移动障碍物(行人和车辆)的基础上,快速规划出无碰撞、平滑且符合运动学约束的安全路径 -环境:python3.13 \ No newline at end of file +# Car_Perception_Automatic_Sensing +自动驾驶环境感知自动感知系统,支持车辆、行人、车道线等目标的检测与分割。 + +## 功能模块 +- 数据加载与预处理(支持 KITTI/Waymo 数据集) +- 深度学习模型搭建(CNN/Transformer 骨干网络) +- 模型训练与验证 +- 推理可视化与结果导出## +- 目录结构 +Car_Perception_Automatic_Sensing/ +- ├── data/ +- ├── model/ +- ├── loss/ +- ├── train/ # 训练脚本目录 +- ├── infer/ # 推理脚本目录 +- ├── utils/ # 工具类目录 +- ├── test/ # 测试用例目录 +- ├── requirements.txt # 依赖配置 +- └── README.md # 项目文档 + +## 环境要求 +Python >= 3.8,PyTorch >= 2.0.0 + +## 快速开始 +1. 克隆仓库 +2. 安装依赖 +3. 准备数据集 +4. 运行训练脚本 \ No newline at end of file diff --git a/src/Car_Perception_Automatic_Sensing/data_loader.py b/src/Car_Perception_Automatic_Sensing/data_loader.py deleted file mode 100644 index eba4500e65..0000000000 --- a/src/Car_Perception_Automatic_Sensing/data_loader.py +++ /dev/null @@ -1,73 +0,0 @@ -""" -数据加载器模块 -负责自动驾驶感知任务的数据集加载、数据预处理分发等功能 -支持图像类数据集(如KITTI、COCO自动驾驶子集)的加载 -""" -import numpy as np -import torch -from torch.utils.data import Dataset, DataLoader - - -class AutoDriveDataset(Dataset): - """ - 自动驾驶感知数据集基类 - 所有自定义数据集需继承此类并实现抽象方法 - """ - def __init__(self, data_root: str, split: str = "train", transform=None): - """ - 初始化数据集 - :param data_root: 数据集根目录路径 - :param split: 数据集划分(train/val/test) - :param transform: 数据增强/预处理变换 - """ - self.data_root = data_root - self.split = split - self.transform = transform - self.sample_list = [] # 存储样本路径/索引的列表 - - # 后续将实现:加载样本列表 - self._load_sample_list() - - def _load_sample_list(self): - """ - 加载数据集样本列表(抽象方法,需子类实现) - """ - raise NotImplementedError("子类必须实现 _load_sample_list 方法") - - def __len__(self): - """ - 返回数据集样本总数 - """ - return len(self.sample_list) - - def __getitem__(self, idx: int): - """ - 根据索引获取单个样本(抽象方法,需子类实现) - :param idx: 样本索引 - :return: 处理后的图像和标注数据 - """ - raise NotImplementedError("子类必须实现 __getitem__ 方法") - - -def build_dataloader(dataset: Dataset, batch_size: int, shuffle: bool = True, num_workers: int = 4): - """ - 构建数据加载器 - :param dataset: 实例化的 Dataset 对象 - :param batch_size: 批次大小 - :param shuffle: 是否打乱样本顺序 - :param num_workers: 数据加载进程数 - :return: DataLoader 对象 - """ - dataloader = DataLoader( - dataset=dataset, - batch_size=batch_size, - shuffle=shuffle, - num_workers=num_workers, - pin_memory=True # 加速GPU数据传输 - ) - return dataloader - - -if __name__ == "__main__": - # 测试代码框架(后续可完善) - pass \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000000..e69de29bb2