Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Archive Tests #50

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions tests/unittests/test_core/test_archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import onnx
import pytest
from luxonis_ml.data import LuxonisDataset
from luxonis_ml.nn_archive.config_building_blocks.base_models import head_outputs
from parameterized import parameterized

import luxonis_train
Expand Down Expand Up @@ -209,7 +208,6 @@ def dataset_generator():
print("Deleting existing dataset")
LuxonisDataset(ldf_name).delete_dataset()
dataset = LuxonisDataset(ldf_name)
dataset.set_classes(list(labels))
if kpt_anno:
keypoint_labels = [
"kp1",
Expand Down Expand Up @@ -333,27 +331,6 @@ def test_config_io(self, head_name):

assert valid_inputs and valid_outputs

@parameterized.expand(HEAD_NAMES)
def test_head_outputs(self, head_name):
"""Tests if archived config head outputs are valid."""
archive_path = os.path.join(self.tmp_path, f"nnarchive_{head_name}_onnx.tar.xz")
with tarfile.open(archive_path, mode="r") as tar:
f = tar.extractfile("config.json")
json_dict = json.load(f)
head_output = json_dict["model"]["heads"][0]["outputs"]
if head_name == "ClassificationHead":
assert head_outputs.OutputsClassification.parse_obj(head_output)
elif head_name == "EfficientBBoxHead":
assert head_outputs.OutputsYOLO.parse_obj(head_output)
elif head_name == "ImplicitKeypointBBoxHead":
assert head_outputs.OutputsKeypointDetectionYOLO.parse_obj(head_output)
elif head_name == "SegmentationHead":
assert head_outputs.OutputsSegmentation.parse_obj(head_output)
elif head_name == "BiSeNetHead":
assert head_outputs.OutputsSegmentation.parse_obj(head_output)
else:
raise NotImplementedError(f"Missing tests for {head_name} head")

@classmethod
def teardown_class(cls):
"""Removes all files created during setup."""
Expand Down
Loading