py-feat
py-feat copied to clipboard
colab is working but i get an error on my local notebook
Hello, when I try to run this cell:
from feat.detector import Detector
detector = Detector(verbose=True)
detector
I get a runtime error that looks like this:
Cell In[6], line 4
1 from feat.detector import Detector
----> 4 detector = Detector(verbose=True)
6 detector
File ~\miniconda3\lib\site-packages\feat\detector.py:121, in Detector.__init__(self, face_model, landmark_model, au_model, emotion_model, facepose_model, device, n_jobs, verbose, **kwargs)
116 # Verify model names and download if necessary
117 face, landmark, au, emotion, facepose = get_pretrained_models(
118 face_model, landmark_model, au_model, emotion_model, facepose_model, verbose
119 )
--> 121 self._init_detectors(
122 face,
123 landmark,
124 au,
125 emotion,
126 facepose,
127 openface_2d_landmark_columns,
128 **kwargs,
129 )
File ~\miniconda3\lib\site-packages\feat\detector.py:249, in Detector._init_detectors(self, face, landmark, au, emotion, facepose, openface_2d_landmark_columns, **kwargs)
247 self.facepose_detector = fetch_model("facepose_model", facepose)
248 if "img2pose" in facepose:
--> 249 self.facepose_detector = self.facepose_detector(
250 constrained="img2pose-c" == face,
251 device=self.device,
252 **facepose_model_kwargs,
253 )
254 else:
255 self.facepose_detector = self.facepose_detector(**facepose_model_kwargs)
File ~\miniconda3\lib\site-packages\feat\facepose_detectors\img2pose\img2pose_test.py:54, in Img2Pose.__init__(self, device, constrained, detection_threshold, nms_threshold, nms_inclusion_threshold, top_k, keep_top_k, BORDER_SIZE, DEPTH, MAX_SIZE, MIN_SIZE, RETURN_DIM, POSE_MEAN, POSE_STDDEV, THREED_FACE_MODEL, **kwargs)
51 pose_stddev = np.load(POSE_STDDEV, allow_pickle=True)
52 threed_points = np.load(THREED_FACE_MODEL, allow_pickle=True)
---> 54 self.model = img2poseModel(
55 DEPTH,
56 MIN_SIZE,
57 MAX_SIZE,
58 pose_mean=pose_mean,
59 pose_stddev=pose_stddev,
60 threed_68_points=threed_points,
61 device=self.device,
62 **kwargs,
63 )
65 # Load the constrained model
66 model_file = "img2pose_v1_ft_300w_lp.pth" if constrained else "img2pose_v1.pth"
File ~\miniconda3\lib\site-packages\feat\facepose_detectors\img2pose\img2pose_model.py:60, in img2poseModel.__init__(self, depth, min_size, max_size, device, pose_mean, pose_stddev, threed_68_points, rpn_pre_nms_top_n_test, rpn_post_nms_top_n_test, bbox_x_factor, bbox_y_factor, expand_forehead)
57 pose_stddev = torch.tensor(pose_stddev)
59 if threed_68_points is not None:
---> 60 threed_68_points = torch.tensor(threed_68_points)
62 # create the feature pyramid network
63 self.fpn_model = FasterDoFRCNN(
64 backbone,
65 2,
(...)
75 expand_forehead=expand_forehead,
76 )
RuntimeError: Could not infer dtype of numpy.float32
```
It works just fine on google colab but I want to use it on my PC. I don't have much experience in coding in general, sorry if it is an obvious thing but why do I get this error? Thanks in advance.
Z