facebookresearch / supervision-by-registration

Supervision-by-Registration: An Unsupervised Approach to Improve the Precision of Facial Landmark Detectors
Other
762 stars 165 forks source link

Error for eval.py #31

Closed NikolayTV closed 6 years ago

NikolayTV commented 6 years ago

I want to run pretrainded model on image to get landmarks. I placed downloaded model im .snapshots/ folder. OS Ubuntu 16.04

And when I run: python ./exps/eval.py --image ./cache_data/cache/self.jpeg --model snapshots/300W-CPM-DET/checkpoint/cpm_vgg16-epoch-049-050.pth --face 250 150 900 1100 --save ./cache_data/cache/test.jpeg

I get following error:

The image is ./cache_data/cache/self.jpeg The model is snapshots/300W-CPM-DET/checkpoint/cpm_vgg16-epoch-049-050.pth The face bounding box is [250.0, 150.0, 900.0, 1100.0] Traceback (most recent call last): File "./exps/eval.py", line 88, in evaluate(args)
File "./exps/eval.py", line 34, in evaluate snapshot = torch.load(snapshot)
File "/home/nikolaytv/.virtualenvs/VEmain/lib/python3.5/site-packages/torch/serialization.py", line 301, in load f = open(f, 'rb') TypeError: invalid file: PosixPath('snapshots/300W-CPM-DET/checkpoint/cpm_vgg16-epoch-049-050.pth')

D-X-Y commented 6 years ago

Sorry for the late reply. I will check this soon.

NikolayTV commented 6 years ago

I fixed error by changing image = draw_image_by_points(args.image, prediction, 2, (255, 0, 0), args.face, resize) on image = draw_image_by_points(Image.open(args.image), prediction, 2, (255, 0, 0), args.face, resize)

And also I had to redownload vgg model in torch lib, it was corrupt. Now it works well

D-X-Y commented 6 years ago

👍 👍 👍