Skip to content

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

Merged
kvaikunthan merged 4 commits into
masterfrom
revamp
Oct 13, 2026
Merged

kvaikunthan merged 4 commits into
masterfrom
revamp

Conversation

@harshi-puli

@harshi-puli harshi-puli commented Sep 22, 2026 •

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/.
  • Moved local sample data into the repo-level ignored data/ directory.
  • Moved local model weights into data/gate_yolo_weights/.
  • Refactored split_gate_data.py into an import-safe, testable dataset splitter with CLI arguments.
  • Added gate YOLO tests, including splitter tests and a guarded YOLO prediction smoke test.
  • Made optional saliency/archive imports lazy in perception/__init__.py so tests can collect without optional compiled extensions.
  • Added repo hygiene READMEs for:
    • perception/misc/
    • perception/third_party/

The new READMEs document what belongs in each folder, what currently lives there, and how future integration should be handled.

Testing

pytest perception/tasks/gate/tests/test_yolo_split.py \
       perception/tasks/gate/tests/test_yolo_predict_smoke.py
## How to test

```bash
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.

Organize gate YOLO assets, configs, and smoke tests

@kvaikunthan kvaikunthan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ts tuff af

@kvaikunthan
kvaikunthan merged commit bdc0bc8 into master Oct 13, 2026
2 checks passed
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