Skip to content

Commit

Permalink
set iou_threshold by default
Browse files Browse the repository at this point in the history
  • Loading branch information
bw4sz committed Sep 30, 2024
1 parent a6df3e2 commit ed8b1c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepforest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def configure_optimizers(self):
else:
return optimizer

def evaluate(self, csv_file, root_dir, iou_threshold=None, savedir=None):
def evaluate(self, csv_file, root_dir, iou_threshold=0.4, savedir=None):
"""Compute intersection-over-union and precision/recall for a given
iou_threshold.
Expand All @@ -800,6 +800,9 @@ def evaluate(self, csv_file, root_dir, iou_threshold=None, savedir=None):
ground_df["label"] = ground_df.label.apply(lambda x: self.label_dict[x])
predictions = self.predict_file(csv_file=csv_file, root_dir=root_dir)

if iou_threshold is None:
iou_threshold = self.config["validation"]["iou_threshold"]

results = evaluate_iou.__evaluate_wrapper__(
predictions=predictions,
ground_df=ground_df,
Expand Down

0 comments on commit ed8b1c8

Please sign in to comment.