Skip to content

Commit

Permalink
Fixing graph visualization (#108)
Browse files Browse the repository at this point in the history
* fix

* update yaml

---------

Co-authored-by: Ofri Masad <ofrimasad@users.noreply.github.com>
  • Loading branch information
Louis-Dupont and ofrimasad authored Jun 22, 2023
1 parent d51786d commit 9e3a2eb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/data_gradients/config/detection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ report_sections:
- DetectionClassesPerImageCount
- DetectionBoundingBoxIoU:
num_bins: 10
class_agnostic: true
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def update(self, sample: DetectionSample):
def aggregate(self) -> Feature:
df = pd.DataFrame(self.data)

max_area = min(100, df["relative_bbox_area"].max())
plot_options = ViolinPlotOptions(
x_label_key="relative_bbox_area",
x_label_name="Bounding Box Area (in % of image)",
Expand All @@ -40,6 +41,7 @@ def aggregate(self) -> Feature:
title=self.title,
x_ticks_rotation=None,
labels_key="split",
x_lim=(0, max_area),
bandwidth=0.4,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DetectionBoundingBoxIoU(AbstractFeatureExtractor):
"""Feature Extractor to compute the pairwise IoU of bounding boxes per image.
This feature extractor helps to identify duplicate/highly overlapping bounding boxes."""

def __init__(self, num_bins: int = 10, class_agnostic: bool = False):
def __init__(self, num_bins: int = 10, class_agnostic: bool = True):
"""
:param num_bins: Number of bins to use for the heatmap plot.
:param class_agnostic: If True, only check IoU of bounding boxes of the same class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def aggregate(self) -> Feature:
kde=False,
labels_key="split",
individual_plots_key="split",
stat="percent",
x_ticks_rotation=None,
sharey=True,
labels_palette=LABELS_PALETTE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def aggregate(self) -> Feature:
y_label_name="Class Names",
order_key="class_id",
title=self.title,
x_lim=(0, df_class_count["n_appearance"].max() * 1.2),
bandwidth=0.4,
x_ticks_rotation=None,
labels_key="split",
Expand Down

0 comments on commit 9e3a2eb

Please sign in to comment.