File size: 702 Bytes
35384df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os

# Specify the directory to check
directory = "val/"

# Initialize counter for empty files
empty_file_count = 0

# Loop through all files in the directory
for filename in os.listdir(directory):
    file_path = os.path.join(directory, filename)
    # print(file_path)
    # Check if it's a file (not a directory)
    if os.path.isfile(file_path) and not ('bg' in file_path or 'paper_aug' in file_path):
        # Get file size in bytes
        file_size = os.path.getsize(file_path)
        if file_size == 0:
            print(f"Empty file found: {filename}")
            empty_file_count += 1

# Print the total count of empty files
print(f"Total number of empty files: {empty_file_count}")