Showing the changes to python/tests/utils.py (1 of 3 files). Show all
Unified · Split
| @@ -47,3 +47,14 @@ def count_samples_in_directory(samples_dir): · 46 unmodified lines | |||
| 47 | if file_path: | 47 | if file_path: |
| 48 | total_frames += count_samples_in_file(file_path) | 48 | total_frames += count_samples_in_file(file_path) |
| 49 | return total_frames | 49 | return total_frames |
| 50 | |||
| 51 | def count_files_in_directory(samples_dir): | ||
| 52 | import os | ||
| 53 | total_files = 0 | ||
| 54 | for f in os.walk(samples_dir): | ||
| 55 | if len(f[2]): | ||
| 56 | for each in f[2]: | ||
| 57 | file_path = os.path.join(f[0], each) | ||
| 58 | if file_path: | ||
| 59 | total_files += 1 | ||
| 60 | return total_files | ||