for name in os.listdir(directory):
path = input("Enter the file path")
As written you're looking for a file named
0.jpg in the directory of the script itself. You want to be looking in the directory you pass in.
So instead do: