meow commited on
Commit
5ee737a
1 Parent(s): 66db7fc
Files changed (37) hide show
  1. app.py +2 -1
  2. data_loaders/__pycache__/get_data.cpython-310.pyc +0 -0
  3. data_loaders/__pycache__/tensors.cpython-310.pyc +0 -0
  4. data_loaders/humanml/common/__pycache__/quaternion.cpython-310.pyc +0 -0
  5. data_loaders/humanml/common/__pycache__/skeleton.cpython-310.pyc +0 -0
  6. data_loaders/humanml/data/__pycache__/__init__.cpython-310.pyc +0 -0
  7. data_loaders/humanml/data/__pycache__/dataset_ours_single_seq.cpython-310.pyc +0 -0
  8. data_loaders/humanml/data/__pycache__/utils.cpython-310.pyc +0 -0
  9. data_loaders/humanml/data/dataset_ours_single_seq.py +7 -5
  10. data_loaders/humanml/scripts/__pycache__/motion_process.cpython-310.pyc +0 -0
  11. data_loaders/humanml/utils/__pycache__/paramUtil.cpython-310.pyc +0 -0
  12. diffusion/__pycache__/fp16_util.cpython-310.pyc +0 -0
  13. diffusion/__pycache__/gaussian_diffusion.cpython-310.pyc +0 -0
  14. diffusion/__pycache__/gaussian_diffusion_ours.cpython-310.pyc +0 -0
  15. diffusion/__pycache__/logger.cpython-310.pyc +0 -0
  16. diffusion/__pycache__/losses.cpython-310.pyc +0 -0
  17. diffusion/__pycache__/nn.cpython-310.pyc +0 -0
  18. diffusion/__pycache__/resample.cpython-310.pyc +0 -0
  19. diffusion/__pycache__/respace.cpython-310.pyc +0 -0
  20. diffusion/__pycache__/respace_ours.cpython-310.pyc +0 -0
  21. gradio_inter/__pycache__/__init__.cpython-310.pyc +0 -0
  22. gradio_inter/__pycache__/create_bash_file.cpython-310.pyc +0 -0
  23. gradio_inter/__pycache__/predict_from_file.cpython-310.pyc +0 -0
  24. model/__pycache__/mdm_ours.cpython-310.pyc +0 -0
  25. requirements.txt +6 -3
  26. sample/__pycache__/reconstruct_data.cpython-310.pyc +0 -0
  27. sample/reconstruct_data.py +7 -7
  28. train/__pycache__/train_platforms.cpython-310.pyc +0 -0
  29. train/__pycache__/training_loop_ours.cpython-310.pyc +0 -0
  30. train/training_loop_ours.py +4 -4
  31. utils/__pycache__/common_utils.cpython-310.pyc +0 -0
  32. utils/__pycache__/dist_util.cpython-310.pyc +0 -0
  33. utils/__pycache__/fixseed.cpython-310.pyc +0 -0
  34. utils/__pycache__/model_util.cpython-310.pyc +0 -0
  35. utils/__pycache__/model_utils.cpython-310.pyc +0 -0
  36. utils/__pycache__/parser_util.cpython-310.pyc +0 -0
  37. utils/dist_util.py +4 -2
app.py CHANGED
@@ -38,13 +38,14 @@ def predict(file_path: str):
38
  temp_bash_file = create_bash_file(temp_file_path)
39
 
40
  os.system(f"bash {temp_bash_file}")
 
41
 
42
 
43
  demo = gr.Interface(
44
  predict,
45
  # gr.Dataframe(type="numpy", datatype="number", row_count=5, col_count=3),
46
  gr.File(type="filepath"),
47
- "numpy",
48
  cache_examples=False
49
  )
50
 
 
38
  temp_bash_file = create_bash_file(temp_file_path)
39
 
40
  os.system(f"bash {temp_bash_file}")
41
+ return temp_file_path
42
 
43
 
44
  demo = gr.Interface(
45
  predict,
46
  # gr.Dataframe(type="numpy", datatype="number", row_count=5, col_count=3),
47
  gr.File(type="filepath"),
48
+ "file",
49
  cache_examples=False
50
  )
51
 
data_loaders/__pycache__/get_data.cpython-310.pyc ADDED
Binary file (4.39 kB). View file
 
data_loaders/__pycache__/tensors.cpython-310.pyc ADDED
Binary file (6.47 kB). View file
 
data_loaders/humanml/common/__pycache__/quaternion.cpython-310.pyc ADDED
Binary file (11.3 kB). View file
 
data_loaders/humanml/common/__pycache__/skeleton.cpython-310.pyc ADDED
Binary file (6.14 kB). View file
 
data_loaders/humanml/data/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (167 Bytes). View file
 
data_loaders/humanml/data/__pycache__/dataset_ours_single_seq.cpython-310.pyc ADDED
Binary file (79.8 kB). View file
 
data_loaders/humanml/data/__pycache__/utils.cpython-310.pyc ADDED
Binary file (15.2 kB). View file
 
data_loaders/humanml/data/dataset_ours_single_seq.py CHANGED
@@ -3451,7 +3451,8 @@ class GRAB_Dataset_V19(torch.utils.data.Dataset): # GRAB datasset and
3451
  base_pts = object_pc_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
3452
  base_normals = object_normal_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
3453
  nn_base_pts = self.nn_base_pts
3454
- base_pts_idxes = utils.farthest_point_sampling(base_pts[0:1], n_sampling=nn_base_pts)
 
3455
  base_pts_idxes = base_pts_idxes[:nn_base_pts]
3456
  base_pts = base_pts[:, base_pts_idxes]
3457
  base_normals = base_normals[:, base_pts_idxes]
@@ -7720,10 +7721,11 @@ class GRAB_Dataset_V19_HHO(torch.utils.data.Dataset): # GRAB datasset #
7720
  base_pts = object_pc_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
7721
  base_normals = object_normal_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
7722
  nn_base_pts = self.nn_base_pts
7723
- base_pts_idxes = utils.farthest_point_sampling(base_pts[0:1], n_sampling=nn_base_pts)
7724
- base_pts_idxes = base_pts_idxes[:nn_base_pts]
7725
- base_pts = base_pts[:, base_pts_idxes]
7726
- base_normals = base_normals[:, base_pts_idxes]
 
7727
 
7728
  base_pts_global_orient_mtx = object_global_orient_mtx_th # ws x 3 x 3 #
7729
  base_pts_transl = object_trcansl_th # ws x 3 #
 
3451
  base_pts = object_pc_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
3452
  base_normals = object_normal_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
3453
  nn_base_pts = self.nn_base_pts
3454
+ if base_pts.size(1) > nn_base_pts:
3455
+ base_pts_idxes = utils.farthest_point_sampling(base_pts[0:1], n_sampling=nn_base_pts)
3456
  base_pts_idxes = base_pts_idxes[:nn_base_pts]
3457
  base_pts = base_pts[:, base_pts_idxes]
3458
  base_normals = base_normals[:, base_pts_idxes]
 
7721
  base_pts = object_pc_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
7722
  base_normals = object_normal_th[:, base_pts_mask] # ws x nn_valid_obj_pcs x 3 #
7723
  nn_base_pts = self.nn_base_pts
7724
+ if base_pts.size(-1) > nn_base_pts:
7725
+ base_pts_idxes = utils.farthest_point_sampling(base_pts[0:1], n_sampling=nn_base_pts)
7726
+ base_pts_idxes = base_pts_idxes[:nn_base_pts]
7727
+ base_pts = base_pts[:, base_pts_idxes]
7728
+ base_normals = base_normals[:, base_pts_idxes]
7729
 
7730
  base_pts_global_orient_mtx = object_global_orient_mtx_th # ws x 3 x 3 #
7731
  base_pts_transl = object_trcansl_th # ws x 3 #
data_loaders/humanml/scripts/__pycache__/motion_process.cpython-310.pyc ADDED
Binary file (9.77 kB). View file
 
data_loaders/humanml/utils/__pycache__/paramUtil.cpython-310.pyc ADDED
Binary file (1.49 kB). View file
 
diffusion/__pycache__/fp16_util.cpython-310.pyc ADDED
Binary file (7.83 kB). View file
 
diffusion/__pycache__/gaussian_diffusion.cpython-310.pyc ADDED
Binary file (43.5 kB). View file
 
diffusion/__pycache__/gaussian_diffusion_ours.cpython-310.pyc ADDED
Binary file (213 kB). View file
 
diffusion/__pycache__/logger.cpython-310.pyc ADDED
Binary file (15.4 kB). View file
 
diffusion/__pycache__/losses.cpython-310.pyc ADDED
Binary file (2.51 kB). View file
 
diffusion/__pycache__/nn.cpython-310.pyc ADDED
Binary file (7.04 kB). View file
 
diffusion/__pycache__/resample.cpython-310.pyc ADDED
Binary file (6.77 kB). View file
 
diffusion/__pycache__/respace.cpython-310.pyc ADDED
Binary file (5.07 kB). View file
 
diffusion/__pycache__/respace_ours.cpython-310.pyc ADDED
Binary file (13 kB). View file
 
gradio_inter/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (152 Bytes). View file
 
gradio_inter/__pycache__/create_bash_file.cpython-310.pyc ADDED
Binary file (658 Bytes). View file
 
gradio_inter/__pycache__/predict_from_file.cpython-310.pyc ADDED
Binary file (8.29 kB). View file
 
model/__pycache__/mdm_ours.cpython-310.pyc ADDED
Binary file (42.5 kB). View file
 
requirements.txt CHANGED
@@ -2,11 +2,11 @@
2
  -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
3
  # pip==20.2.4
4
  torch==1.12.1
5
- torchvision==0.13.1
6
- torchaudio==0.12.1
7
  blobfile==2.0.1
8
  manopth @ git+https://github.com/hassony2/manopth.git
9
- numpy
10
  psutil
11
  scikit-learn
12
  scipy
@@ -14,3 +14,6 @@ tensorboard
14
  tensorboardx
15
  tqdm
16
  trimesh
 
 
 
 
2
  -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
3
  # pip==20.2.4
4
  torch==1.12.1
5
+ # torchvision==0.13.1
6
+ # torchaudio==0.12.1
7
  blobfile==2.0.1
8
  manopth @ git+https://github.com/hassony2/manopth.git
9
+ numpy==1.23.1
10
  psutil
11
  scikit-learn
12
  scipy
 
14
  tensorboardx
15
  tqdm
16
  trimesh
17
+ clip
18
+ chumpy
19
+ opencv-python
sample/__pycache__/reconstruct_data.cpython-310.pyc ADDED
Binary file (22.9 kB). View file
 
sample/reconstruct_data.py CHANGED
@@ -4,19 +4,19 @@ sys.path.insert(0, '..')
4
 
5
  import torch
6
  import torch.nn.functional as F
7
- from torch import optim, nn
8
  import numpy as np
9
- import os, argparse, copy, json
10
- import pickle as pkl
11
- from scipy.spatial.transform import Rotation as R
12
- from psbody.mesh import Mesh
13
  from manopth.manolayer import ManoLayer
14
  # from dataloading import GRAB_Single_Frame, GRAB_Single_Frame_V6, GRAB_Single_Frame_V7, GRAB_Single_Frame_V8, GRAB_Single_Frame_V9, GRAB_Single_Frame_V9_Ours, GRAB_Single_Frame_V10
15
  # use_trans_encoders
16
  # from model import TemporalPointAE, TemporalPointAEV2, TemporalPointAEV5, TemporalPointAEV6, TemporalPointAEV7, TemporalPointAEV8, TemporalPointAEV9, TemporalPointAEV10, TemporalPointAEV4, TemporalPointAEV3_Real, TemporalPointAEV11, TemporalPointAEV12, TemporalPointAEV13, TemporalPointAEV14, TemporalPointAEV17, TemporalPointAEV19, TemporalPointAEV20, TemporalPointAEV21, TemporalPointAEV22, TemporalPointAEV23, TemporalPointAEV24, TemporalPointAEV25, TemporalPointAEV26
17
- import trimesh
18
  from utils import *
19
- import utils
20
  import utils.model_util as model_util
21
  # from anchorutils import anchor_load_driver, recover_anchor, recover_anchor_batch
22
 
 
4
 
5
  import torch
6
  import torch.nn.functional as F
7
+ from torch import optim
8
  import numpy as np
9
+ # import os, argparse, copy, json
10
+ # import pickle as pkl
11
+ # from scipy.spatial.transform import Rotation as R
12
+ # from psbody.mesh import Mesh
13
  from manopth.manolayer import ManoLayer
14
  # from dataloading import GRAB_Single_Frame, GRAB_Single_Frame_V6, GRAB_Single_Frame_V7, GRAB_Single_Frame_V8, GRAB_Single_Frame_V9, GRAB_Single_Frame_V9_Ours, GRAB_Single_Frame_V10
15
  # use_trans_encoders
16
  # from model import TemporalPointAE, TemporalPointAEV2, TemporalPointAEV5, TemporalPointAEV6, TemporalPointAEV7, TemporalPointAEV8, TemporalPointAEV9, TemporalPointAEV10, TemporalPointAEV4, TemporalPointAEV3_Real, TemporalPointAEV11, TemporalPointAEV12, TemporalPointAEV13, TemporalPointAEV14, TemporalPointAEV17, TemporalPointAEV19, TemporalPointAEV20, TemporalPointAEV21, TemporalPointAEV22, TemporalPointAEV23, TemporalPointAEV24, TemporalPointAEV25, TemporalPointAEV26
17
+ # import trimesh
18
  from utils import *
19
+ # import utils
20
  import utils.model_util as model_util
21
  # from anchorutils import anchor_load_driver, recover_anchor, recover_anchor_batch
22
 
train/__pycache__/train_platforms.cpython-310.pyc ADDED
Binary file (2.73 kB). View file
 
train/__pycache__/training_loop_ours.cpython-310.pyc CHANGED
Binary files a/train/__pycache__/training_loop_ours.cpython-310.pyc and b/train/__pycache__/training_loop_ours.cpython-310.pyc differ
 
train/training_loop_ours.py CHANGED
@@ -57,7 +57,7 @@ class TrainLoop:
57
  self.num_steps = args.num_steps
58
  self.num_epochs = self.num_steps // len(self.data) + 1
59
 
60
- self.sync_cuda = torch.cuda.is_available()
61
 
62
  if self.args.finetune_with_cond: # finetune_with_cond ->
63
  self._load_and_sync_parameters_cond() # load parameters here
@@ -85,10 +85,10 @@ class TrainLoop:
85
  # Model was resumed, either due to a restart or a checkpoint
86
  # being specified at the command line.
87
 
88
- print(f"dist_utils: {dist_util.dev()}")
89
  self.device = torch.device("cpu")
90
- if torch.cuda.is_available() and dist_util.dev() != 'cpu':
91
- self.device = torch.device(dist_util.dev())
92
 
93
  self.schedule_sampler_type = 'uniform'
94
  self.schedule_sampler = create_named_schedule_sampler(self.schedule_sampler_type, diffusion)
 
57
  self.num_steps = args.num_steps
58
  self.num_epochs = self.num_steps // len(self.data) + 1
59
 
60
+ self.sync_cuda = False # torch.cuda.is_available()
61
 
62
  if self.args.finetune_with_cond: # finetune_with_cond ->
63
  self._load_and_sync_parameters_cond() # load parameters here
 
85
  # Model was resumed, either due to a restart or a checkpoint
86
  # being specified at the command line.
87
 
88
+ print(f"dist_utils: {dist_util.dev()}")
89
  self.device = torch.device("cpu")
90
+ # if torch.cuda.is_available() and dist_util.dev() != 'cpu':
91
+ # self.device = torch.device(dist_util.dev())
92
 
93
  self.schedule_sampler_type = 'uniform'
94
  self.schedule_sampler = create_named_schedule_sampler(self.schedule_sampler_type, diffusion)
utils/__pycache__/common_utils.cpython-310.pyc ADDED
Binary file (13.3 kB). View file
 
utils/__pycache__/dist_util.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/dist_util.cpython-310.pyc and b/utils/__pycache__/dist_util.cpython-310.pyc differ
 
utils/__pycache__/fixseed.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/fixseed.cpython-310.pyc and b/utils/__pycache__/fixseed.cpython-310.pyc differ
 
utils/__pycache__/model_util.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/model_util.cpython-310.pyc and b/utils/__pycache__/model_util.cpython-310.pyc differ
 
utils/__pycache__/model_utils.cpython-310.pyc ADDED
Binary file (5.42 kB). View file
 
utils/__pycache__/parser_util.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/parser_util.cpython-310.pyc and b/utils/__pycache__/parser_util.cpython-310.pyc differ
 
utils/dist_util.py CHANGED
@@ -45,10 +45,12 @@ def dev():
45
  """
46
  Get the device to use for torch.distributed.
47
  """
 
48
  global used_device
49
- if th.cuda.is_available() and used_device>=0:
50
- return th.device(f"cuda:{used_device}")
51
  return th.device("cpu")
 
 
 
52
 
53
 
54
  def load_state_dict(path, **kwargs):
 
45
  """
46
  Get the device to use for torch.distributed.
47
  """
48
+
49
  global used_device
 
 
50
  return th.device("cpu")
51
+ # if th.cuda.is_available() and used_device>=0:
52
+ # return th.device(f"cuda:{used_device}")
53
+ # return th.device("cpu")
54
 
55
 
56
  def load_state_dict(path, **kwargs):