videoavatars icon indicating copy to clipboard operation
videoavatars copied to clipboard

Fix Bug For python 3

Open noratap09 opened this issue 2 years ago • 5 comments

It can run but I didn't test the output correct .

noratap09 avatar Jul 06 '22 02:07 noratap09

Getting error while running step1_pose.py : 2022-12-22 00:11:53,996 [acceleratesupport.py::13] OpenGL_accelerate module loaded 2022-12-22 00:11:54,028 [arraydatatype.py::275] Using accelerated ArrayDatatype 2022-12-22 00:11:55,528 [step1_pose.py:main:310] Initial fit 2022-12-22 00:11:55,543 [step1_pose.py:main:340] Fit frame 0 camera_mtx [[ 1.33211487e+03 0.00000000e+00 2.55890277e+02] [ 0.00000000e+00 -1.33234639e+03 2.83562715e+02] [ 0.00000000e+00 0.00000000e+00 1.00000000e+00]] 2022-12-22 00:11:55,543 [step1_pose.py:reinit_frame:135] Tracking error too large. Re-init frame... 4.30e+05 | init_pose: 4.30e+05 1.25e+05 | init_pose: 1.25e+05 9.23e+03 | init_pose: 9.23e+03 1.37e+03 | init_pose: 1.37e+03 2.09e+02 | init_pose: 2.09e+02 4.00e+01 | init_pose: 4.00e+01 3.92e+01 | init_pose: 3.92e+01 1.46e+03 | pose: 1.46e+03 | prior: 0.00e+00 2.89e+02 | pose: 2.54e+02 | prior: 3.43e+01 2.55e+02 | pose: 2.21e+02 | prior: 3.42e+01 2.55e+02 | pose: 2.18e+02 | prior: 3.66e+01 Traceback (most recent call last): File "step1_pose.py", line 402, in args.body_height, args.nohands, args.display) File "step1_pose.py", line 344, in main fit_pose(current_frame, last_smpl, frustum, nohands, debug_rn) File "step1_pose.py", line 200, in fit_pose bgcolor=0, num_channels=1) File "C:\Users\RAJ\anaconda3\envs\vaa\lib\site-packages\chumpy\ch.py", line 129, in new result.set(**defs) File "C:\Users\RAJ\anaconda3\envs\vaa\lib\site-packages\chumpy\ch.py", line 482, in set self.setattr(kwall[-1], kwargs[kwall[-1]], None) File "C:\Users\RAJ\anaconda3\envs\vaa\lib\site-packages\chumpy\ch.py", line 407, in setattr object.setattr(self, name, value) AttributeError: can't set attribute

raj-gupta1 avatar Dec 21 '22 18:12 raj-gupta1

@noratap09 @thmoa opendr==0.77 , chumpy==0.70 , python==3.8.15

Traceback (most recent call last): File "step1_pose.py", line 409, in main(args.keypoint_file, args.masks_file, args.camera, args.out, args.model, args.prior, args.resize, File "step1_pose.py", line 352, in main fit_pose(current_frame, last_smpl, frustum, nohands, debug_rn) File "step1_pose.py", line 203, in fit_pose 'mask': gaussian_pyramid(rn_m * dist_o * 100. + (1 - rn_m) * dist_i, n_levels=4, normalization='size') * 80., File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/opendr-0.77-py3.8-linux-x86_64.egg/opendr/filters.py", line 53, in gaussian_pyramid imshape = input_objective.shape File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch.py", line 317, in shape return self.r.shape File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch.py", line 596, in r self._cache['r'] = np.asarray(np.atleast_1d(self.compute_r()), dtype=np.float64, order='C') File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch_ops.py", line 550, in compute_r return self.a.r + self.b.r File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch.py", line 596, in r self._cache['r'] = np.asarray(np.atleast_1d(self.compute_r()), dtype=np.float64, order='C') File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch_ops.py", line 708, in compute_r return self.a.r * self.b.r File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch.py", line 596, in r self._cache['r'] = np.asarray(np.atleast_1d(self.compute_r()), dtype=np.float64, order='C') File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch_ops.py", line 708, in compute_r return self.a.r * self.b.r File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch.py", line 594, in r self._call_on_changed() File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/chumpy/ch.py", line 589, in _call_on_changed self.on_changed(self._dirty_vars) File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/opendr-0.77-py3.8-linux-x86_64.egg/opendr/renderer.py", line 327, in on_changed setup_camera(self.glb, self.camera, self.frustum) File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/opendr-0.77-py3.8-linux-x86_64.egg/opendr/renderer.py", line 699, in setup_camera _setup_camera(gl, File "/home/shinigami/anaconda3/envs/vda/lib/python3.8/site-packages/opendr-0.77-py3.8-linux-x86_64.egg/opendr/renderer.py", line 820, in _setup_camera gl.ShaderSource(vs, 1, vs_source, len(vs_source)) File "opendr/contexts/ctx_base.pyx", line 24, in opendr.contexts.ctx_mesa.mc.with_make_current File "opendr/contexts/ctx_base.pyx", line 464, in opendr.contexts.ctx_mesa.OsContextBase.ShaderSource TypeError: expected bytes, str found

raj-gupta1 avatar Jan 05 '23 08:01 raj-gupta1

home/shinigami/

I'm not sure maybe camera.pkl file incorrect or opendr bug What data you used such as "female-1-casual" download from https://graphics.tu-bs.de/people-snapshot

Do you download and install SMPL and SMPLify in "videoavatars/vendor" folder

my [run_step1.sh ]

#!/bin/bash

if [ "$#" -le 1 ]; then
    echo "usage: run_step1.sh <path_to_subject_directory> <output_directory> [options]" >&2
    exit 1
fi

SUBJ="$1"
OUT="$2"

if [[ $SUBJ = *"female"* ]]; then
  MODEL='--model vendor/smpl/models/basicModel_m_lbs_10_207_0_v1.0.0.pkl'
fi

python step1_pose.py $SUBJ/keypoints.hdf5 $SUBJ/masks.hdf5 $SUBJ/camera.pkl $OUT/reconstructed_poses.hdf5 $MODEL ${@:3}

I hope it helps

noratap09 avatar Jan 12 '23 04:01 noratap09

Thanks for the reply. I was waiting for this. Let me check this out.

On Thu, Jan 12, 2023 at 10:23 AM noratap09 @.***> wrote:

home/shinigami/

I'm not sure maybe camera.pkl file incorrect or opendr bug What data you used such as "female-1-casual" download from https://graphics.tu-bs.de/people-snapshot

Do you download and install SMPL and SMPLify in "videoavatars/vendor" folder

my [run_step1.sh ]

#!/bin/bash

if [ "$#" -le 1 ]; then echo "usage: run_step1.sh <path_to_subject_directory> <output_directory> [options]" >&2 exit 1 fi

SUBJ="$1" OUT="$2"

if [[ $SUBJ = "female" ]]; then MODEL='--model vendor/smpl/models/basicModel_m_lbs_10_207_0_v1.0.0.pkl' fi

python step1_pose.py $SUBJ/keypoints.hdf5 $SUBJ/masks.hdf5 $SUBJ/camera.pkl $OUT/reconstructed_poses.hdf5 $MODEL ${@:3}

I hope it helps

— Reply to this email directly, view it on GitHub https://github.com/thmoa/videoavatars/pull/85#issuecomment-1379811762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANMRLWERU64SSVQIK5NMQELWR6E5JANCNFSM52YC7O4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

raj-gupta1 avatar Jan 12 '23 06:01 raj-gupta1

Did you guys solve it ? I have that error too .

Traceback (most recent call last):
  File "step1_pose.py", line 377, in <module>
    args.body_height, args.nohands, args.display)
  File "step1_pose.py", line 319, in main
    fit_pose(current_frame, last_smpl, frustum, nohands, debug_rn)
  File "step1_pose.py", line 197, in fit_pose
    bgcolor=0, num_channels=1)
  File "C:\Users\ADMIN\anaconda3\envs\avatar2\lib\site-packages\chumpy\ch.py", line 129, in __new__
    result.set(**defs)
  File "C:\Users\ADMIN\anaconda3\envs\avatar2\lib\site-packages\chumpy\ch.py", line 482, in set
    self.__setattr__(kwall[-1], kwargs[kwall[-1]], None)
  File "C:\Users\ADMIN\anaconda3\envs\avatar2\lib\site-packages\chumpy\ch.py", line 407, in __setattr__
    object.__setattr__(self, name, value)
AttributeError: can't set attribute

TharHtetAungg avatar Aug 04 '23 07:08 TharHtetAungg