Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0f9b297
1
lj2302 Dec 18, 2025
5a338a4
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 18, 2025
5808e48
1
lj2302 Dec 18, 2025
541c063
无人车动态障碍物避障算法
lj2302 Dec 19, 2025
369b66f
Merge remote-tracking branch 'origin/main'
lj2302 Dec 19, 2025
426fe49
提交选题
lj2302 Dec 19, 2025
d58a1bb
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 19, 2025
3cabf9e
删除多余的.idea文件,更改项目名
lj2302 Dec 19, 2025
c924f07
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 19, 2025
5a2c700
创建 requirements.txt,列出依赖库(numpy、torch、opencv 等)
lj2302 Dec 19, 2025
cf8b30b
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 19, 2025
0d378c6
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 19, 2025
0f21da3
[env] add requirements.txt for dependencies
lj2302 Dec 19, 2025
7c93572
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 19, 2025
47aac2b
Mergebranch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 19, 2025
253c385
[env] add requirements.txt for dependencies
lj2302 Dec 19, 2025
25a85db
[data] create data_loader.py skeleton
lj2302 Dec 19, 2025
8bc6c8a
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 19, 2025
83da6df
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 19, 2025
5aba4cc
[data] create data_loader.py skeleton
lj2302 Dec 19, 2025
fdf5378
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 19, 2025
4ad68fc
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 20, 2025
b810224
[data] implement image loading function
lj2302 Dec 20, 2025
e577267
Merge branch 'main' into main
lj2302 Dec 20, 2025
ff12afc
[data] implement image loading function
lj2302 Dec 20, 2025
ba39e3f
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 20, 2025
a11507c
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 20, 2025
f035164
[data] implement image loading function
lj2302 Dec 21, 2025
70be789
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 21, 2025
81a8d90
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 21, 2025
26d2d28
[data] implement image loading function
lj2302 Dec 21, 2025
b73684c
rge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 21, 2025
007c7f2
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 21, 2025
46c748b
tMerge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 21, 2025
ddb58fc
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 21, 2025
0253ecd
[data] create data module with dataset base class and image loading f…
lj2302 Dec 21, 2025
ce8b265
[data] create data module with dataset base class and image loading f…
lj2302 Dec 21, 2025
fb3d477
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 21, 2025
cc68945
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 22, 2025
717d3f8
[data] implement image loading function
lj2302 Dec 22, 2025
2fb3e2b
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 22, 2025
11d002c
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 22, 2025
21be098
[data] implement image loading function
lj2302 Dec 22, 2025
4b845a1
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 22, 2025
75c8c56
Merge branch 'main' of https://github.com/lj2302/nn2
lj2302 Dec 22, 2025
78f834a
[data] create data/ directory and data_loader.py skeleton
lj2302 Dec 22, 2025
dd3411d
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 22, 2025
9ba1569
Merge branch 'OpenHUTB:main' into main
lj2302 Dec 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added data/__init__.py
Empty file.
41 changes: 41 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -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: <SomeEnabledInspectionId>

#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>

#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> #(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-<linter>:2025.2
58 changes: 58 additions & 0 deletions src/Car_Perception_Automatic_Sensing/data/data_loader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"""
数据加载器核心模块
支持自动驾驶数据集的加载、样本管理与批次分发
"""
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from typing import Optional, List


class AutoDriveDataset(Dataset):
"""自动驾驶感知数据集基类(所有自定义数据集需继承此类)"""
def __init__(self, data_root: str, split: str = "train", transform: Optional[object] = None):
self.data_root = os.path.abspath(data_root)
self.split = split
self.transform = transform
self.sample_paths: List[str] = [] # 存储所有样本路径
self._load_sample_paths() # 加载样本列表

def _load_sample_paths(self):
"""加载样本路径(抽象方法,子类实现)"""
raise NotImplementedError("请在子类中实现 _load_sample_paths 方法")

def __len__(self) -> int:
"""返回样本总数"""
return len(self.sample_paths)

def __getitem__(self, idx: int):
"""获取单个样本(抽象方法,子类实现)"""
raise NotImplementedError("请在子类中实现 __getitem__ 方法")


def build_dataloader(
dataset: Dataset,
batch_size: int,
shuffle: bool = True,
num_workers: int = 4,
drop_last: bool = False
) -> DataLoader:
"""构建PyTorch DataLoader(跨系统兼容)"""
# Windows系统默认关闭多进程
if os.name == "nt":
num_workers = 0

return DataLoader(
dataset=dataset,
batch_size=batch_size,
shuffle=shuffle,
num_workers=num_workers,
pin_memory=True,
drop_last=drop_last
)


if __name__ == "__main__":
# 框架测试
pass
73 changes: 0 additions & 73 deletions src/Car_Perception_Automatic_Sensing/data_loader.py

This file was deleted.

Empty file added src/__init__.py
Empty file.
Loading