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

evaluate a single image #51

Closed JiHaoqina closed 5 years ago

JiHaoqina commented 5 years ago

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

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] The general dataset initialization done : GeneralDataset(point-num=-1, sigma=4.0, heatmap_type=gaussian, length=0, dataset=300W-68) Initialize cpm-vgg16 with configure : Configure(arch='cpm_vgg16', pretrained=[True], pooling=[True, True, True], dilation=[1], stages=3, downsample=8, argmax=4) vgg16_base use pre-trained model Traceback (most recent call last): File "./exps/eval.py", line 90, in evaluate(args) File "./exps/eval.py", line 51, in evaluate weights = remove_module_dict(snapshot['detector']) KeyError: 'detector'

when i want to evaluate a single image, something went wrong. Does anyone know what the problem is? Thanks!

D-X-Y commented 5 years ago

I will take a look at this problem, and will response you soon.

D-X-Y commented 5 years ago

@JiHaoqina You can replace line 51 with

  try:
    weights = remove_module_dict(snapshot['detector'])
  except:
    weights = remove_module_dict(snapshot['state_dict'])

It is a version problem. The eval.py is not updated along with the training script.

JiHaoqina commented 5 years ago

It works,thank you!

D-X-Y commented 5 years ago

You can welcome. Would you mind to close this issue?