Skip to content

Commit

Permalink
Validation for vision results (#3377)
Browse files Browse the repository at this point in the history
* Validation for vision results.

* Changelog and setup updates.
  • Loading branch information
rdondera-microsoft authored Sep 16, 2024
1 parent fefc90c commit 99c48b3
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scripts/azureml-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

### 🐛 Bugs Fixed

## 1.16.58 (2024-09-13)
### 🐛 Bugs Fixed
- [#3377](https://github.com/Azure/azureml-assets/pull/3377) Validation for vision results

## 1.16.57 (2024-08-12)
### 🐛 Bugs Fixed
- [#3253](https://github.com/Azure/azureml-assets/pull/3253) Also accept Path types for populating tags from files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ evaluation_type:
values:
- text_generation
- text_embeddings
- vision
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Valid tag values that can be applied to evaluation results whose evaluation_type is `vision`.
task:
required: True
allow_multiple: False
values:
- image-generation
- image-vqa
2 changes: 2 additions & 0 deletions scripts/azureml-assets/azureml/assets/validate_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,8 @@ def validate_assets(input_dirs: List[Path],
error_count += validate_tags(asset_config, 'evaluationresult/tag_values_text_generation.yaml')
elif evaluation_type == 'text_embeddings':
error_count += validate_tags(asset_config, 'evaluationresult/tag_values_text_embeddings.yaml')
elif evaluation_type == 'vision':
error_count += validate_tags(asset_config, 'evaluationresult/tag_values_vision.yaml')
else:
_log_error(
asset_config.file_name_with_path,
Expand Down
2 changes: 1 addition & 1 deletion scripts/azureml-assets/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="azureml-assets",
version="1.16.57",
version="1.16.58",
description="Utilities for publishing assets to Azure Machine Learning system registries.",
author="Microsoft Corp",
packages=find_packages(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: evaluationresult
spec: spec.yaml
categories: ["EvaluationResult"]
24 changes: 24 additions & 0 deletions test/resources/validate/evaluationresult/vision_correct/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
type: evaluationresult
name: vision_correct
version: 1
display_name: vision_correct
description: vision_correct
dataset_name: dataset1
dataset_family: family1

model_name: model1
model_version: "1"
model_asset_id: azureml://registries/azureml/models/model1/versions/1
relationships:
- relationshipType: Source
assetId: azureml://registries/azureml/models/model1/versions/1

tags:
evaluation_type: vision
task: image-generation
primary_metric: fid

metrics:
fid: 300.1

properties: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: evaluationresult
spec: spec.yaml
categories: ["EvaluationResult"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
type: evaluationresult
name: vision_incorrect
version: 1
display_name: vision_incorrect
description: vision_incorrect
dataset_name: dataset1
dataset_family: family1

model_name: model1
model_version: "1"
model_asset_id: azureml://registries/azureml/models/model1/versions/1
relationships:
- relationshipType: Source
assetId: azureml://registries/azureml/models/model1/versions/1

tags:
evaluation_type: vision
task: image-understanding
primary_metric: visual_intelligence

metrics:
ndcg_at_10: 0.001

properties: {}
2 changes: 2 additions & 0 deletions test/test_validate_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
("evaluationresult/text_embeddings_incorrect", False, True, None, False),
("evaluationresult/text_generation_correct", False, True, None, True),
("evaluationresult/text_generation_incorrect", False, True, None, False),
("evaluationresult/vision_correct", False, True, None, True),
("evaluationresult/vision_incorrect", False, True, None, False),
]
)
def test_validate_assets(test_subdir: str, check_images: bool, check_names: bool,
Expand Down

0 comments on commit 99c48b3

Please sign in to comment.