Skip to content

Commit 4aaa160

Browse files
committed
Update training pipeline to HDF5, add data access scripts, and readme updates
- Updated training pipeline for HDF5-based dataset workflow - Implemented convert_tif_to_npy.py for TIF to NPY conversion with validation - Modified dataset classes and dataloaders to use HDF5 storage format - Fixed classifier code and model architectures for NPY array handling - Updated training scripts to work with new data format - Added user-friendly data access scripts - Created quickstart.py for dataset loading demonstration - Developed download_dataset.py for automated dataset download from Dropbox - Added get_dataloaders.py for simple PyTorch DataLoader generation - Updated README with clear usage instructions - Updated package configuration for UV compatibility - Updated pyproject.toml dependencies and structure - Added proper dependency groups (dev, processing, logging) - Added development infrastructure - GitHub Actions CI pipeline for automated testing - Pre-commit hooks with Black code formatting - Basic test suite with test_imports.py - Added baseline results: RGB 53.5%, HSI 27.3%, LiDAR 11.5%
1 parent 0cba1e4 commit 4aaa160

32 files changed

+5057
-49972
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
python-version: ['3.9', '3.10', '3.11', '3.12']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install uv
26+
run: pip install uv
27+
28+
- name: Install dependencies
29+
run: |
30+
uv sync --all-extras
31+
32+
- name: Test imports
33+
run: |
34+
uv run python -c "
35+
import neon_tree_classification
36+
from neon_tree_classification import NeonCrownDataset
37+
from scripts.get_dataloaders import get_dataloaders
38+
print('All imports successful!')
39+
"
40+
41+
- name: Run tests
42+
run: uv run pytest tests/ -v --tb=short
43+
44+
lint:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: '3.11'
53+
54+
- name: Install uv
55+
run: pip install uv
56+
57+
- name: Install dependencies
58+
run: |
59+
uv sync --extra dev
60+
61+
- name: Check code formatting
62+
run: uv run black --check neon_tree_classification/ examples/ scripts/ tests/

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ dist/
3030
.venv/
3131
uv.lock
3232

33+
# Downloaded dataset files
34+
_neon_tree_classification_dataset_files/
35+
3336
# IDE/Editor
3437
.vscode/
3538

@@ -63,4 +66,4 @@ uv.lock
6366
.Spotlight-V100
6467
.Trashes
6568
ehthumbs.db
66-
Thumbs.db
69+
Thumbs.db

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
args: ['--maxkb=1000']
10+
11+
- repo: https://github.com/psf/black
12+
rev: 25.1.0
13+
hooks:
14+
- id: black
15+
files: |
16+
(?x)^(
17+
neon_tree_classification/.*\.py|
18+
examples/.*\.py|
19+
scripts/.*\.py|
20+
tests/.*\.py
21+
)$

CONTRIBUTING.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributing to NEON Tree Classification
2+
3+
Thank you for your interest in contributing! We welcome contributions from researchers at all technical levels.
4+
5+
## 🚀 Quick Start for Contributors
6+
7+
### Option 1: UV Setup (Recommended)
8+
UV is faster and ensures consistent dependencies across all users.
9+
10+
```bash
11+
# 1. Fork the repository on GitHub (click the Fork button)
12+
# 2. Clone your fork
13+
git clone https://github.com/yourusername/NeonTreeClassification.git
14+
cd NeonTreeClassification
15+
16+
# 3. Install UV if you don't have it
17+
curl -LsSf https://astral.sh/uv/install.sh | sh
18+
# or: pip install uv
19+
20+
# 4. Install the package
21+
uv sync
22+
```
23+
24+
### Option 2: Pip Setup (Alternative)
25+
If you prefer traditional pip or can't install UV:
26+
27+
```bash
28+
# After cloning (steps 1-2 above)
29+
pip install -e .
30+
```
31+
32+
> **Note**: UV is preferred because it ensures all contributors have the same dependency versions using the `uv.lock` file.
33+
34+
## 🤝 How to Contribute
35+
36+
### 1. Found a Bug?
37+
- Open an [issue](https://github.com/Ritesh313/NeonTreeClassification/issues)
38+
- Describe what you expected vs what happened
39+
- Include any error messages
40+
41+
### 2. Have a Feature Idea?
42+
- Open an [issue](https://github.com/Ritesh313/NeonTreeClassification/issues) to discuss it first
43+
- We can help figure out the best approach
44+
45+
### 3. Want to Contribute Code?
46+
1. **Create a branch**: `git checkout -b your-feature-name`
47+
2. **Make changes**: Edit files, add features, fix bugs
48+
3. **Test it works**: `uv run python -c "import neon_tree_classification; print('Works!')"`
49+
4. **Submit**: Create a Pull Request on GitHub
50+
51+
> **For advanced testing**: Use `uv sync --all-extras` to install development tools, then run `uv run pytest tests/`
52+
53+
## 💡 Easy Ways to Help
54+
55+
**No coding required:**
56+
- Report bugs or issues you encounter
57+
- Suggest improvements to documentation
58+
- Share example use cases
59+
- Test the package with your data and report results
60+
61+
**Light coding:**
62+
- Fix typos in documentation
63+
- Add examples or tutorials
64+
- Improve error messages
65+
66+
**More involved:**
67+
- Add new model architectures
68+
- Improve data processing tools
69+
- Add visualization features
70+
71+
## 🆘 Need Help?
72+
73+
- **First time with Git/GitHub?** Check out [GitHub's guides](https://guides.github.com/)
74+
- **Python packaging confusion?** Just ask in an issue - we're happy to help!
75+
- **Not sure where to start?** Look for issues labeled "good first issue"
76+
77+
## 📝 Guidelines
78+
79+
- **Be descriptive** in commit messages and pull requests
80+
- **Test your changes** - make sure imports still work
81+
- **Ask questions** - we'd rather help than have you struggle alone
82+
83+
We appreciate all contributions, whether it's fixing a typo or adding a major feature!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Ritesh Chowdhry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)