I am working with images to extract data into CSV. but currently, I want to name the header of CSV as an image folder name. The structure is this
The structure for my CSV file looks like this
My code is
import glob
import os
files = glob.glob('/content/drive/MyDrive/YOLO_T_ID/yolov5/runs/detect/exp5/crops/**/*.jpg', recursive=True)
for f in files:
dir_path = os.path.dirname(os.path.abspath(files))
print(f)


