genforce / idinvert

[ECCV 2020] In-Domain GAN Inversion for Real Image Editing
https://genforce.github.io/idinvert/
MIT License
461 stars 65 forks source link

Can't Interpolate Non-Face Images #34

Closed ghost closed 4 years ago

ghost commented 4 years ago

When I upload an image of the Eiffel Tower, i get the following:

IndexError                                Traceback (most recent call last)

<ipython-input-6-3463c31d9724> in <module>()
     24 if uploaded:
     25   src_image_name = list(uploaded.keys())[0]
---> 26   src_image = align(inverter, src_image_name)
     27   if src_image.shape[2] == 4:
     28     src_image = src_image[:, :, :3]

1 frames

<ipython-input-3-3730a37eebf4> in align(inverter, image_path)
    204   """Aligns an unloaded image."""
    205   aligned_image = align_face(image_path,
--> 206                              align_size=inverter.G.resolution)
    207   return aligned_image
    208 

<ipython-input-3-3730a37eebf4> in align_face(image_path, align_size)
    179   model = FaceLandmarkDetector(align_size)
    180   face_infos = model.detect(image_path)
--> 181   face_infos = face_infos[0]
    182   img = model.align(face_infos)
    183   return img

IndexError: list index out of range

I'm running the code using colab.

zhujiapeng commented 4 years ago

The colab code only supports the face images