Motion Reconstruction Day 5

Progress

Running refine_video.py

Changed to use TensorFlow v1 (they used v1)

-import tensorflow as tf
+import tensorflow.compat.v1 as tf

Changed all paths

-kVidDir = '/home/kanazawa/projects/hmr_sfv/demo_data/videos/'
+kVidDir = 'demo_data/videos/'
 # Where the smoothed results will be stored.
-kOutDir = '/home/kanazawa/projects/hmr_sfv/demo_data/results_smoothed/'
+kOutDir = 'demo_data/results_smoothed/'
 # Holds h5 for each video, which stores OP outputs, after trajectory assignment.
-kOpDir = '/home/kanazawa/projects/hmr_sfv/demo_data/openpose_output'
+kOpDir = 'demo_data/openpose_output'

Could not find neutral_smpl_with_cocoplus_reg.pkl but later found it in another repo

Could not find initializer but then found tensorflow slim package

-from tensorflow.contrib.layers.python.layers.initializers import variance_scaling_initializer
+from tf_slim.layers.initializers import variance_scaling_initializer

cPickle not needed anymore to import pickle

Super random error but found sketchy website that solved it

unicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
-        with open(pkl_path, 'r') as f:
-            dd = pickle.load(f)    
+        with open(pkl_path, 'rb') as f:
+            dd = pickle.load(f, encoding='iso-8859-1')

Changed datatype errors and other basic errors

Realized that image was not a python package but something they wrote (took so long to find resize_img)

-    from image import resize_img
+    from src.util.image import resize_img

Outstanding Issues

Only provided 2 arguments, need 3

working on backflip_a.mp4
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/claire/sandbox/motion_reconstruction/refine_video.py", line 289, in <module>
    main(config)
  File "/home/claire/sandbox/motion_reconstruction/refine_video.py", line 259, in main
    run_video(frames, per_frame_people, config, out_mov_path)
  File "/home/claire/sandbox/motion_reconstruction/refine_video.py", line 81, in run_video
    model = Refiner(config, num_frames)
  File "/home/claire/sandbox/motion_reconstruction/src/refiner.py", line 109, in __init__
    self.build_refine_model()
  File "/home/claire/sandbox/motion_reconstruction/src/refiner.py", line 155, in build_refine_model
    self.img_feat, self.E_var = img_enc_fn(
  File "/home/claire/sandbox/motion_reconstruction/src/models.py", line 37, in Encoder_resnet
    with tf.name_scope("Encoder_resnet", [x]):
  File "/home/claire/venv/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 6562, in __init__
    self._name_scope = name_scope(
  File "/home/claire/venv/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 6428, in name_scope
    return internal_name_scope_v1(name, default_name, values)
  File "/home/claire/venv/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 6466, in __init__
    raise TypeError(
TypeError: `default_name` type (<class 'list'>) is not a string type. You likely meant to pass this into the `values` kwarg.