mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 12:06:36 +00:00
a47fa135de
- Modified `.gitignore` to include test fixture data while excluding test results. - Updated `config.yaml` to change the model from 'yolo11m.yaml' to 'yolo26m.pt'. - Enhanced `.cursor/rules/coderule.mdc` with additional guidelines for test environment consistency and infrastructure handling. - Revised autopilot state management in `_docs/_autopilot_state.md` to reflect current progress and tasks. - Removed outdated augmentation tests and adjusted dataset formation tests to align with the new structure. These changes streamline the configuration and testing processes, ensuring better organization and clarity in the project.
60 lines
1.7 KiB
Python
60 lines
1.7 KiB
Python
import constants as c
|
|
|
|
|
|
def test_fixture_images_dir_has_jpegs(fixture_images_dir):
|
|
jpgs = list(fixture_images_dir.glob("*.jpg"))
|
|
assert len(jpgs) == 20
|
|
|
|
|
|
def test_fixture_labels_dir_has_yolo_labels(fixture_labels_dir):
|
|
txts = list(fixture_labels_dir.glob("*.txt"))
|
|
assert len(txts) == 20
|
|
|
|
|
|
def test_fixture_onnx_model_bytes(fixture_onnx_model):
|
|
assert len(fixture_onnx_model) > 0
|
|
|
|
|
|
def test_fixture_classes_json_exists(fixture_classes_json):
|
|
assert fixture_classes_json.is_file()
|
|
assert fixture_classes_json.name == "classes.json"
|
|
|
|
|
|
def test_work_dir_layout(work_dir):
|
|
assert (work_dir / "images").is_dir()
|
|
assert (work_dir / "labels").is_dir()
|
|
|
|
|
|
def test_sample_image_label_paths(sample_image_label):
|
|
img, lbl = sample_image_label
|
|
assert img.suffix.lower() == ".jpg"
|
|
assert lbl.suffix == ".txt"
|
|
assert img.exists() and lbl.exists()
|
|
assert img.stem == lbl.stem
|
|
|
|
|
|
def test_sample_images_labels_factory(sample_images_labels):
|
|
img_dir, lbl_dir = sample_images_labels(3)
|
|
assert len(list(img_dir.glob("*.jpg"))) == 3
|
|
assert len(list(lbl_dir.glob("*.txt"))) == 3
|
|
|
|
|
|
def test_corrupted_label_content(corrupted_label):
|
|
text = corrupted_label.read_text(encoding="utf-8")
|
|
assert "1.5" in text
|
|
|
|
|
|
def test_edge_bbox_label_exists(edge_bbox_label):
|
|
assert edge_bbox_label.read_text(encoding="utf-8").strip()
|
|
|
|
|
|
def test_empty_label_file(empty_label):
|
|
assert empty_label.read_text(encoding="utf-8") == ""
|
|
|
|
|
|
def test_constants_patch_uses_tmp(constants_patch, tmp_path):
|
|
constants_patch(tmp_path)
|
|
assert c.config.root.startswith(str(tmp_path))
|
|
assert c.config.data_dir.startswith(str(tmp_path))
|
|
assert c.config.current_onnx_model.startswith(str(tmp_path))
|