Skip to content

Commit

Permalink
Don't repeat class example images (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-lightly authored Nov 10, 2023
1 parent 02890bc commit 6d78b9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lightly_insights/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ def analyze_object_detections(
class_datum.heatmap[int(y1) : int(y2), int(x1) : int(x2)] += 1

# Sample images.
if len(class_datum.sample_filenames) < 4:
if (
len(class_datum.sample_filenames) < 4
and label.image.filename not in class_datum.sample_filenames
):
class_datum.sample_filenames.append(label.image.filename)

# Update objects per image for classes.
Expand Down

0 comments on commit 6d78b9f

Please sign in to comment.