Open mrgloom opened 8 years ago
Sorry to hear you're having so many issues with the library; thanks for bearing with me as I examine them. Would you mind sending me the image(s) that cause the segfault?
In response to your second question, pinned
should be a list of points in the same format as the landmarks returned by search_single
or similar.
I think problem not in specific images, but in the fact that function called many times (maybe some memory issues?)
However I tried this test and it's works:
import os.path
import cv2
import stasm
path = os.path.join(stasm.DATADIR, 'testface.jpg')
for i in range(0, 1000):
print i
img = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
if img is None:
print("Cannot load", path)
raise SystemExit
landmarks = stasm.search_single(img)
if len(landmarks) == 0:
print("No face found in", path)
else:
landmarks = stasm.force_points_into_image(landmarks, img)
for point in landmarks:
img[round(point[1])][round(point[0])] = 255
#cv2.imshow("stasm minimal", img)
#cv2.waitKey(0)
here is the data which I used with my script https://drive.google.com/file/d/0B88eZEyituf8OUYwNzNNajI1TUk/view?usp=sharing
I get Segmentation fault (core dumped) using PyStasm. It happends sometimes on image 98, and sometimes after all images processed.
http://stackoverflow.com/questions/13654449/error-segmentation-fault-core-dumped
Here is my code: https://github.com/mrgloom/Kaggle-Facial-Keypoints-Detection-Solutions/blob/master/stasm_example.py
pip freeze
Another question is how to use
stasm.search_pinned
when I have croped face and don't need face detection? in what formatpinned
input should be?