What error do you get?
unfold is a method which should be called by or on a tensor. Based on your code snippet it looks like you are calling it on a file path (string).
Load the images, transform them to tensors, and then call unfold on them.