Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve heatmap description #170

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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