Skip to content

Organize gate YOLO assets, configs, and smoke tests - #81

Merged
harshi-puli merged 5 commits into
revampfrom
yolo-gate
Sep 21, 2026
Merged

harshi-puli merged 5 commits into
revampfrom
yolo-gate

Conversation

@harshi-puli

Copy link
Copy Markdown
Contributor

Summary

  • Organized gate YOLO files under perception/tasks/gate/yolo/ so source code, configs, tests, local datasets, and model weights have clearer homes.
  • Moved dataset configs into perception/tasks/gate/yolo/configs/:
    • gate_dataset.yaml
    • legacy_dataset.yaml
  • Moved local sample data into the repo-level ignored data/ directory:
    • data/gate_yolo_sample/train
    • data/gate_yolo_sample/val
    • data/gate_yolo_sample/test
  • Moved local model weights into:
    • data/gate_yolo_weights/
  • Refactored split_gate_data.py into an import-safe, testable dataset splitter with CLI arguments.
  • Kept split_data.py as a compatibility wrapper around the new splitter.
  • Updated YOLO helper defaults in predict_gate.py and export_metrics.py to use repo-local data/ and configs/ paths instead of user-specific absolute paths.
  • Added gate YOLO tests:
    • splitter layout/unit tests
    • guarded YOLO prediction smoke test that runs when ultralytics is installed
  • Made optional saliency/archive imports lazy in perception/__init__.py so tests can collect even when the optional Cython saliency extension is not built.

How to test

cd "perception"

# Run the gate YOLO splitter tests and prediction smoke test
pytest perception/tasks/gate/tests/test_yolo_split.py \
       perception/tasks/gate/tests/test_yolo_predict_smoke.py

Expected result without YOLO dependencies installed:

2 passed, 1 skipped

The skipped test is the YOLO inference smoke test. It skips automatically when ultralytics is not installed.

How to test YOLO prediction locally

Install the YOLO/Torch dependencies first:

uv pip install -r requirements-torch.txt

Or, if not using uv:

pip install ultralytics

Then run the smoke test again:

pytest perception/tasks/gate/tests/test_yolo_predict_smoke.py

The test loads:

data/gate_yolo_weights/yolo11n.pt

and predicts on two images from:

data/gate_yolo_sample/test/images/

Manual prediction command

python perception/tasks/gate/yolo/predict_gate.py \
  --source data/gate_yolo_sample/test/images \
  --model data/gate_yolo_weights/yolo11n.pt \
  --output data/gate_yolo_predictions

Predictions are written to:

data/gate_yolo_predictions/run/

Dataset splitting command

To split a generated YOLO-style dataset with images/ and labels/ folders:

python -m perception.tasks.gate.yolo.split_gate_data \
  --source path/to/generated/gate_dataset \
  --output data/gate_yolo_sample

By default, this creates:

train/images
train/labels
val/images
val/labels
test/images
test/labels

Notes

  • The local sample dataset and YOLO weights live under data/, which is already gitignored.
  • The prediction smoke test is intentionally guarded so CI or local classical-only environments do not fail when YOLO dependencies are missing.
  • Torch/YOLO CI coverage is not added in this PR.

kvaikunthan and others added 5 commits August 10, 2026 22:46
Gate Part 1: Merging Exisiting XFeat Orientation Repo + Reorganizing Gate to Propsed Structure
Reorganizing outdated tasks into Archive and and updating structure of said tasks
Adding Algo Registration  + Connecting to Vis
vis compare flag + uv environment change + fixing Github workflow
@harshi-puli
harshi-puli merged commit 2a57ef5 into revamp Sep 21, 2026
2 checks passed
kvaikunthan added a commit that referenced this pull request Oct 13, 2026
Organize gate YOLO assets, configs, and smoke tests- #81
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