## pythonimport csv
import os
from natsort import natsortedfolder_path ='/home/database/BOSS_all/BOSSbase_1.01'# 指定完整文件夹路径
file_names =[f.name for f in os.scandir(folder_path)if f.is_file()]# 获取指定文件夹下的所有文件名
sorted_image_files = natsorted(file_names)# 对文件名进行自然排序sorted_image_files =[x[:-4]for x in sorted_image_files]# 去掉后缀.pngprint(sorted_image_files)# 指定要遍历的文件夹路径
fnns_path ='/home/train'# 获取指定文件夹下的所有文件名
file_names =[f.name for f in os.scandir(fnns_path)if f.is_file()]# 对文件名进行自然排序
sorted_fnns_files = natsorted(file_names)
sorted_fnns_files =[x[:-4]for x in sorted_fnns_files]# 去掉后缀.pngprint(sorted_fnns_files)# 求差集
set1 =set(sorted_image_files[:6000])
set2 =set(sorted_fnns_files)
result =list(set1 - set2)print(result)