Skip to content

Commit

Permalink
Improve heatmap description (#170)
Browse files Browse the repository at this point in the history
* fix

* fix text

---------

Co-authored-by: Shay Aharon <[email protected]>
  • Loading branch information
Louis-Dupont and shaydeci authored Aug 7, 2023
1 parent 114e108 commit 06dec7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Tuple
from typing import Tuple, Optional
import numpy as np
from data_gradients.common.registry.registry import register_feature_extractor
from data_gradients.utils.data_classes import DetectionSample
Expand Down Expand Up @@ -42,11 +42,13 @@ def description(self) -> str:
"The heatmap represents areas of high object density within the images, providing insights into the spatial distribution of objects. "
"By examining the heatmap, you can quickly detect whether objects are predominantly concentrated in specific regions or if they are evenly "
"distributed throughout the scene. This information can serve as a heuristic to assess if the objects are positioned appropriately "
"within the expected areas of interest."
"within the expected areas of interest.<br/>"
"Note that images are resized to a square of the same dimension, which can affect the aspect ratio of objects. "
"This is done to focus on localization of objects in the scene (e.g. top-right, center, ...) independently of the original image sizes."
)

@property
def notice(self) -> str:
def notice(self) -> Optional[str]:
if len(self.class_names) > self.n_cols * self.n_rows:
return (
f"Only the {self.n_cols * self.n_rows} classes with highest density are shown.<br/>"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Tuple
from typing import Tuple, Optional
import cv2
import numpy as np
from data_gradients.common.registry.registry import register_feature_extractor
Expand Down Expand Up @@ -43,11 +43,13 @@ def description(self) -> str:
"The heatmap represents areas of high object density within the images, providing insights into the spatial distribution of objects. "
"By examining the heatmap, you can quickly detect whether objects are predominantly concentrated in specific regions or if they are evenly "
"distributed throughout the scene. This information can serve as a heuristic to assess if the objects are positioned appropriately "
"within the expected areas of interest."
"within the expected areas of interest.<br/>"
"Note that images are resized to a square of the same dimension, which can affect the aspect ratio of objects. "
"This is done to focus on localization of objects in the scene (e.g. top-right, center, ...) independently of the original image sizes."
)

@property
def notice(self) -> str:
def notice(self) -> Optional[str]:
if len(self.class_names) > self.n_cols * self.n_rows:
return (
f"Only the {self.n_cols * self.n_rows} classes with highest density are shown.<br/>"
Expand Down

0 comments on commit 06dec7f

Please sign in to comment.