Nguyễn Bá Thiêm
Add code to parse and print parent directory name
772e02a
raw
history blame
278 Bytes
from pathlib import Path
path = '/kaggle/input/super-resolution-hust/Super Resolution HUST/Set5/image_SRF_4/'
# Parse the path using pathlib
p = Path(path)
# The 'Set5' part is the parent directory of 'image_SRF_4'
set5_part = p.parent.name
print(set5_part) # Output: Set5