From 9429b720ed5c9630b58e81a59273fac22463b52c Mon Sep 17 00:00:00 2001
From: Stephane Chavin <stephane.chavin@lis-lab.fr>
Date: Fri, 31 Jan 2025 15:11:39 +0100
Subject: [PATCH] remove too small labels

---
 get_train_annot.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/get_train_annot.py b/get_train_annot.py
index 6d680fe..4b2bd2c 100755
--- a/get_train_annot.py
+++ b/get_train_annot.py
@@ -84,7 +84,8 @@ def main(entry, arguments, species_list):
             # Correction if the boxes are corrupted (> 1 or < 0)
             x_pxl, width_pxl = utils.correct_box(x_pxl, width_pxl)
             y_pxl, height_pxl = utils.correct_box(y_pxl, height_pxl)
-
+            if x_pxl > 1 and width_pxl < 0.05:
+                continue
             # Store the annotation in a DataFrame
             new_table = pd.DataFrame([[str(species_list[species_list.species == specie].index[0]),
                                        x_pxl, y_pxl, width_pxl, height_pxl]],
-- 
GitLab