how can I extract images id from image path.
just want to take 10877 from this path /content/gdrive/MyDrive/new/batch/aligned_10877nationalIdFront.png
>Solution :
If there is always an underscore before the image ID and if the ID is always 5 digits long try this:
path_name = "/content/gdrive/MyDrive/new/batch/aligned_10877nationalIdFront.png"
image_id = path_name.split("/")[-1].split("_")[1][:5]
print(image_id)
Print out
10877