Skip to content

Improve CLI and separate into sub-scripts#1255

Merged
bw4sz merged 1 commit intoweecology:mainfrom
jveitchmichaelis:cli-train-improve
Feb 16, 2026
Merged

Improve CLI and separate into sub-scripts#1255
bw4sz merged 1 commit intoweecology:mainfrom
jveitchmichaelis:cli-train-improve

Conversation

@jveitchmichaelis
Copy link
Copy Markdown
Collaborator

@jveitchmichaelis jveitchmichaelis commented Jan 1, 2026

Description

This is a cleaned up version of the training script I used for LIDAR pre-training. I took some inspiration from the bird branch as well to add some more comet features. Docs are updated for all three scripts.

My goal is that users should never need to write scripts and we can be opinionated about defaults that we commonly use ourselves.

  • Split tools into sub scripts for easier organization and testing
  • Improvements to the basic training script to support common training situations:
    • Comet/Tensorboard logging, optional
    • Sensible defaults for log directories, including using comet's experiment key if generated/set and tags
    • Defaults for callbacks (image + checkpoints)
    • Resume support
    • Optional tracing
  • Predict script that supports single/tiled/CSV
  • Evaluate script that takes a prediction CSV from above, or runs on validation.csv_file
  • Better test coverage
  • Reset the default log root directory to ./lightning_logs (as opposed to $PWD).
  • Small fixup in checkpoint tests where we were using a non-standard key for the log directory

AI-Assisted Development

Some use of Claude Code for assisted testing (e.g. checking it can start training jobs).

  • I used AI tools (e.g., GitHub Copilot, ChatGPT, etc.) in developing this PR
  • I understand all the code I'm submitting
  • I have reviewed and validated all AI-generated code

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 67.19577% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.95%. Comparing base (94af652) to head (1d7e2a9).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/deepforest/scripts/cli.py 0.00% 29 Missing ⚠️
src/deepforest/scripts/train.py 61.64% 28 Missing ⚠️
src/deepforest/scripts/predict.py 90.32% 3 Missing ⚠️
src/deepforest/scripts/evaluate.py 96.22% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1255      +/-   ##
==========================================
- Coverage   87.16%   86.95%   -0.21%     
==========================================
  Files          21       24       +3     
  Lines        2851     3005     +154     
==========================================
+ Hits         2485     2613     +128     
- Misses        366      392      +26     
Flag Coverage Δ
unittests 86.95% <67.19%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jveitchmichaelis jveitchmichaelis force-pushed the cli-train-improve branch 3 times, most recently from 61d822a to 0bdff68 Compare January 9, 2026 22:20
@jveitchmichaelis jveitchmichaelis changed the title WIP - Improve CLI Improve CLI and separate into sub-scripts Feb 12, 2026
@jveitchmichaelis jveitchmichaelis force-pushed the cli-train-improve branch 4 times, most recently from d9b6efd to 37b7a6d Compare February 12, 2026 22:41
@jveitchmichaelis jveitchmichaelis marked this pull request as ready for review February 16, 2026 00:53
@jveitchmichaelis
Copy link
Copy Markdown
Collaborator Author

This is squashed and ready for review. These are new public features so feel encouraged to try them out and we can tweak behavior to suit.

Copy link
Copy Markdown
Collaborator

@bw4sz bw4sz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. There are some options that I never personally use, like tensorboard, but I don't think that should limit merging. The whole point here is that the user is not looking at the script, they are using the CLI, so I care less about the large amount of code, since the user doesn't engage with it directy.

@bw4sz bw4sz merged commit 10d5df5 into weecology:main Feb 16, 2026
7 checks passed
tangelll pushed a commit to tangelll/DeepForest that referenced this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants