Path = os.path.join('yalefaces',filename)ĭetector = dlib.get_frontal_face_detector() If filename.endswith('glasses') or filename.endswith('happy') or filename.endswith('noglasses') or filename.endswith('normal'): If (Region + (Y - Region) / (Region - Region) * (Region - Region) < X): Landmarks = (shape.part(i).x, shape.part(i).y) Landmarks = (shape.part(0).x, shape.part(0).y) Landmarks = (shape.part(2).x, shape.part(2).y) Landmarks = (shape.part(1).x, shape.part(1).y) Landmarks= (shape.part(0).x, shape.part(0).y) Y = center_y + radius * math.sin(math.pi + i * math.pi / num_of_points) X = center_x + radius * s(math.pi + i * math.pi / num_of_points) Here is the code i have so far of taking the images, converting them to jpg and cutting them into necessary pieces (which was taken from here ): import sysĭef arc_points(point1, point2, num_of_points): Once i have a bunch of images of randomly pieced together images, i am able to create the gif myself. Im also unsure how to merge or put them back together. The next step I am unable to do is to "align" these faces so that all the pieces form a face when they are merged or put back together. So far, I am able to take the images and cut them into face "pieces" in python in bulk. I have a bunch of face image dataset (taken from ) that I basically want to turn into a gif of the scramble suit from the movie scanner darkly ( ).
0 Comments
Leave a Reply. |