Skip to content

Commit 02a59e5

Browse files
author
TRIP(appergb)
committed
Initial commit: A.YLM - Single-Image 3D Reconstruction and Intelligent Navigation System
- Add complete CI/CD pipeline with GitHub Actions - Configure code quality tools (ruff, mypy, black, isort, flake8) - Add Open3D integration for point cloud processing - Include SHARP model support for 3D Gaussian generation - Set up project structure with proper dependency management - Add comprehensive documentation and licensing
0 parents  commit 02a59e5

34 files changed

Lines changed: 223662 additions & 0 deletions
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## 描述问题
11+
12+
简要描述您遇到的问题。
13+
14+
## 重现步骤
15+
16+
1. 运行 '...'
17+
2. 输入 '....'
18+
3. 看到错误
19+
20+
## 期望行为
21+
22+
描述您期望发生什么。
23+
24+
## 实际行为
25+
26+
描述实际发生了什么。
27+
28+
## 系统信息
29+
30+
- 操作系统: [e.g. macOS 12.0, Ubuntu 20.04, Windows 10]
31+
- Python版本: [e.g. 3.9.0]
32+
- 项目版本: [e.g. v0.0.1-alpha1]
33+
- GPU: [e.g. NVIDIA RTX 3080, Apple M1, None]
34+
35+
## 错误日志
36+
37+
如果适用,请提供完整的错误信息:
38+
39+
```text
40+
在这里粘贴错误日志
41+
```
42+
43+
## 其他信息
44+
45+
任何其他相关信息,如截图、配置文件等。
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## 功能描述
11+
12+
简要描述您想要添加的功能。
13+
14+
## 背景和动机
15+
16+
为什么需要这个功能?它解决了什么问题?
17+
18+
## 建议的实现方式
19+
20+
如果您有具体的实现想法,请描述:
21+
22+
- API设计
23+
- 用户界面
24+
- 技术实现细节
25+
26+
## 替代方案
27+
28+
如果有其他解决方案,请描述。
29+
30+
## 其他信息
31+
32+
任何其他相关信息或截图。

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## 描述
2+
3+
简要描述这个PR做了什么。
4+
5+
## 相关问题
6+
7+
关闭的问题: #123
8+
9+
## 类型
10+
11+
- [ ] 🐛 Bug修复
12+
- [ ] ✨ 新功能
13+
- [ ] 💥 破坏性更改
14+
- [ ] 📚 文档更新
15+
- [ ] 🎨 代码格式
16+
- [ ] ⚡ 性能优化
17+
- [ ] 🧪 测试
18+
- [ ] 🔧 构建/工具
19+
20+
## 检查清单
21+
22+
- [ ] 我的代码遵循项目的代码风格
23+
- [ ] 我已经添加/更新了相关测试
24+
- [ ] 我已经更新了相关文档
25+
- [ ] 所有测试都通过了
26+
- [ ] 我已经检查了我的更改没有引入新的警告
27+
28+
## 测试
29+
30+
描述如何测试这些更改:
31+
32+
```bash
33+
# 测试命令
34+
pytest tests/test_new_feature.py
35+
```
36+
37+
## 截图 (如果适用)
38+
39+
添加任何相关的截图或GIF。
40+
41+
## 其他信息
42+
43+
任何其他需要注意的信息。

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
strategy:
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Set up conda
28+
uses: conda-incubator/setup-miniconda@v3
29+
with:
30+
auto-update-conda: true
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Cache conda dependencies
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/conda_pkgs_dir
38+
${{ env.CONDA }}/envs/test-env-${{ matrix.python-version }}
39+
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt', '**/pyproject.toml', '**/requirements.in') }}
40+
restore-keys: |
41+
${{ runner.os }}-conda-${{ matrix.python-version }}-
42+
${{ runner.os }}-conda-
43+
44+
- name: Install dependencies
45+
run: |
46+
conda install -c conda-forge open3d>=0.17.0 -y
47+
python -m pip install --upgrade pip
48+
pip install -r requirements.txt
49+
pip install -e ml-sharp/
50+
51+
- name: Create required directories
52+
run: |
53+
mkdir -p inputs/input_images
54+
mkdir -p outputs/output_gaussians
55+
mkdir -p models
56+
57+
- name: Basic syntax and import check
58+
run: |
59+
# Check Python syntax for all Python files
60+
find . -name "*.py" -not -path "./venv/*" -not -path "./ml-sharp/*" -exec python -m py_compile {} \;
61+
62+
# Test basic imports
63+
python -c "import sys; sys.path.insert(0, 'src'); import aylm; print('✅ Main package imports successfully')"
64+
python -c "import scripts.coordinate_utils; print('✅ coordinate_utils imports successfully')"
65+
python -c "import scripts.pointcloud_voxelizer; print('✅ pointcloud_voxelizer imports successfully')"
66+
python -c "import scripts.preload_sharp_model; print('✅ preload_sharp_model imports successfully')"
67+
68+
- name: Test script functionality
69+
run: |
70+
# Test help commands
71+
python scripts/preload_sharp_model.py --help || exit 1
72+
python scripts/pointcloud_voxelizer.py --help || exit 1
73+
python scripts/coordinate_utils.py --help 2>/dev/null || echo "coordinate_utils may not have help"
74+
75+
# Test CLI entry points
76+
python -m aylm.cli --help || exit 1
77+
78+
build:
79+
runs-on: ubuntu-latest
80+
needs: test
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
with:
85+
submodules: recursive
86+
87+
- name: Set up Python
88+
uses: actions/setup-python@v4
89+
with:
90+
python-version: "3.9"
91+
92+
- name: Install build dependencies
93+
run: |
94+
python -m pip install --upgrade pip
95+
pip install build twine
96+
97+
- name: Build package
98+
run: python -m build
99+
100+
- name: Check package
101+
run: |
102+
python -m twine check dist/*
103+
104+
- name: Upload build artifacts
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: dist
108+
path: dist/

.github/workflows/code-quality.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.9"
22+
23+
- name: Set up conda
24+
uses: conda-incubator/setup-miniconda@v3
25+
with:
26+
auto-update-conda: true
27+
python-version: "3.9"
28+
29+
- name: Cache conda dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/conda_pkgs_dir
34+
${{ env.CONDA }}/envs/quality-env
35+
key: ${{ runner.os }}-conda-quality-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
36+
restore-keys: |
37+
${{ runner.os }}-conda-quality-
38+
39+
- name: Install quality tools
40+
run: |
41+
conda install -c conda-forge open3d>=0.17.0 -y
42+
python -m pip install --upgrade pip
43+
pip install -r requirements.txt
44+
pip install -e ml-sharp/
45+
pip install black isort flake8 mypy pre-commit safety pip-licenses ruff
46+
47+
- name: Run pre-commit hooks
48+
run: |
49+
# Install pre-commit dependencies first
50+
pre-commit install-hooks
51+
# Run pre-commit on all files
52+
pre-commit run --all-files --show-diff-on-failure
53+
54+
- name: Run Ruff linting
55+
run: |
56+
ruff check --config pyproject.toml src/ scripts/
57+
ruff format --check --config pyproject.toml src/ scripts/
58+
59+
- name: Check security issues
60+
run: safety check
61+
62+
- name: Generate dependency report
63+
run: pip-licenses --format=markdown --output-file=DEPENDENCY_REPORT.md

.github/workflows/model-test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Model Download Test
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Run weekly to ensure model URLs are still valid
7+
- cron: '0 0 * * 0'
8+
9+
jobs:
10+
test-model-download:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Test model URL accessibility
18+
run: |
19+
MODEL_URL="https://ml-site.cdn-apple.com/models/sharp/sharp_2572gikvuh.pt"
20+
echo "Testing model URL: $MODEL_URL"
21+
22+
# Test if URL is accessible
23+
if curl --output /dev/null --silent --head --fail "$MODEL_URL"; then
24+
echo "✅ Model URL is accessible"
25+
else
26+
echo "❌ Model URL is not accessible"
27+
exit 1
28+
fi
29+
30+
- name: Test model download (small portion)
31+
run: |
32+
MODEL_URL="https://ml-site.cdn-apple.com/models/sharp/sharp_2572gikvuh.pt"
33+
34+
# Download just the first 1MB to test
35+
if curl -r 0-1048576 --fail --silent "$MODEL_URL" | head -c 1024 > /dev/null; then
36+
echo "✅ Model download test passed"
37+
else
38+
echo "❌ Model download test failed"
39+
exit 1
40+
fi
41+
42+
- name: Verify model file structure
43+
run: |
44+
# Create models directory
45+
mkdir -p models
46+
47+
# Download full model for structure verification
48+
echo "Downloading model for structure verification..."
49+
curl -L -o models/sharp_2572gikvuh.pt "https://ml-site.cdn-apple.com/models/sharp/sharp_2572gikvuh.pt"
50+
51+
# Check if file exists and has content
52+
if [ -f "models/sharp_2572gikvuh.pt" ] && [ -s "models/sharp_2572gikvuh.pt" ]; then
53+
echo "✅ Model file downloaded successfully"
54+
ls -lh models/sharp_2572gikvuh.pt
55+
else
56+
echo "❌ Model file download failed or file is empty"
57+
exit 1
58+
fi

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
submodules: recursive
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.9"
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build
25+
26+
- name: Build package
27+
run: python -m build
28+
29+
- name: Verify build
30+
run: ls -la dist/

0 commit comments

Comments
 (0)