HavenFeng / photometric_optimization

Photometric optimization code for creating the FLAME texture space and other applications
MIT License
534 stars 97 forks source link

Multiple file missing and wanting for an library list #21

Open lxrswdd opened 1 year ago

lxrswdd commented 1 year ago

When I am running the demo python photometric_fitting.py 00000 cuda First problem: FileNotFoundError: [Errno 2] No such file or directory: './data/generic_model.pkl' I downloaded flame2023.pkl and rename to it. I am not sure this is the right thing to do. Further another problem appeared.

/home/guest/anaconda3/envs/smart_class/lib/python3.10/site-packages/pytorch3d/io/obj_io.py:548: UserWarning: Mtl file does not exist: ./data/template.mtl
  warnings.warn(f"Mtl file does not exist: {f}")
making ./test_results//00000
----iter: 0, time: 2023-06-20-20:31:41
landmark: 0.12438790500164032, all_loss: 0.12438790500164032,
Traceback (most recent call last):
  File "/data/share/FLAME/Photometric_fitting/photometric_optimization/photometric_fitting.py", line 265, in <module>
    fitting.run(imagepath, landmarkpath)
  File "/data/share/FLAME/Photometric_fitting/photometric_optimization/photometric_fitting.py", line 218, in run
    single_params = self.optimize(images, landmarks, image_masks, savefolder)
  File "/data/share/FLAME/Photometric_fitting/photometric_optimization/photometric_fitting.py", line 91, in optimize
    util.tensor_vis_landmarks(images[visind], landmarks[visind]))
  File "/data/share/FLAME/Photometric_fitting/photometric_optimization/util.py", line 209, in tensor_vis_landmarks
    image_landmarks = plot_kpts(image, predicted_landmark, color)
  File "/data/share/FLAME/Photometric_fitting/photometric_optimization/util.py", line 250, in plot_kpts
    image = cv2.circle(image,(st[0], st[1]), 1, c, 2)
cv2.error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function 'circle'
> Overload resolution failed:
>  - Can't parse 'center'. Sequence item with index 0 has a wrong type
>  - Can't parse 'center'. Sequence item with index 0 has a wrong type

In addition, I have to install different versions of libraries to fit the codes? Can you please update an library list so we can install the correct versions?

CengizhanYurdakul commented 1 year ago

same issue

chiewhui1113 commented 10 months ago

Replace line 250 - 254 in util.py to:

image = cv2.circle(image, (int(st[0]), int(st[1])), 1, c, 2) if i in end_list: continue ed = kpts[i + 1, :2] image = cv2.line(image, (int(st[0]), int(st[1])), (int(ed[0]), int(ed[1])), (255, 255, 255), 1)

This works for me

KhanhNgoDuy commented 8 months ago

the generic_model.pkl file can be found in 2020 version