diff --git a/get_train_val.py b/get_train_val.py
index 3393dc1b2ef04c75f9bb896c5d4925462b636131..b4b706b2c300401b105359b11ccc4da93ae315b5 100755
--- a/get_train_val.py
+++ b/get_train_val.py
@@ -72,7 +72,7 @@ def prepare_data(arguments):
     """
     annotations = [] 
     background = []  
-    for f in tqdm(glob.glob(os.path.join(arguments.path_to_data)), desc="Processing", 
+    for f in tqdm(glob.glob(os.path.join(arguments.path_to_data, '*.txt')), desc="Processing", 
                                                             ascii='░▒▓█'):
         file_annotation = pd.read_csv(f, sep=' ', names=['species', 'x', 'y', 'w', 'h'])
         if len(file_annotation) == 0: