Skip to content

Commit

Permalink
add: judge configs to the scores attribute in SpatialRelationshipMetr…
Browse files Browse the repository at this point in the history
…ic2D to be logged to the wandb table
  • Loading branch information
soumik12345 committed Jun 21, 2024
1 parent 6e46579 commit 59b166e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hemm/metrics/spatial_relationship/judges/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ class DETRSpatialRelationShipJudge(weave.Model):
Args:
model_address (str, optional): The address of the model to use.
revision (str, optional): The revision of the model to use.
name (str, optional): The name of the judge model
"""

model_address: str = "facebook/detr-resnet-50"
revision: str = "no_timm"
name: str = "detr_spatial_relationship_judge"
_feature_extractor: DetrImageProcessor = None
_object_detection_model: DetrForObjectDetection = None

Expand Down
5 changes: 4 additions & 1 deletion hemm/metrics/spatial_relationship/spatial_relationship_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __init__(
) -> None:
self.judge = judge
self.judge._initialize_models()
self.judge_config = self.judge.model_dump(mode="json")
self.iou_threshold = iou_threshold
self.distance_threshold = distance_threshold
self.name = name
Expand Down Expand Up @@ -193,7 +194,8 @@ def compose_judgement(
base64_decode_image(annotated_image)
if isinstance(annotated_image, str)
else annotated_image
)
),
"judge_config": self.judge_config,
},
}
)
Expand All @@ -206,6 +208,7 @@ def compose_judgement(
else annotated_image
)
},
"judge_config": self.judge_config,
}

@weave.op()
Expand Down

0 comments on commit 59b166e

Please sign in to comment.