Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
penincillin committed Oct 28, 2020
1 parent b4e25ad commit 741f9c9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ demo.sh
demo_multi.sh
mocap_utils/frame_to_video.py
mocap_utils/frame_to_gif.py
mocap_utils/select_epick_kitchen.py
29 changes: 29 additions & 0 deletions mocap_utils/dist_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os, sys, shutil
import os.path as osp
import general_utils as gnu


def main():
root_dir = "/mnt/SSD/rongyu/data/3D/frank_mocap/dataset/expose"
in_dir = osp.join(root_dir, "image_crop/train")
out_dir = osp.join(root_dir, "image_dist/train")
gnu.renew_dir(out_dir)

num_gpu = 7
all_imgs = gnu.get_all_files(in_dir, (".jpg", ".png"), "name_only")
num_data = len(all_imgs)
num_each = num_data // num_gpu
for i in range(num_gpu):
start = i * num_each
end = (i+1) * num_each if i<num_gpu-1 else num_data
for j in range(start, end):
out_subdir = osp.join(out_dir, str(i))
img_name = all_imgs[j]
in_path = osp.join(in_dir, img_name)
out_path = osp.join(out_subdir, img_name)
gnu.make_subdir(out_path)
shutil.copy2(in_path, out_path)


if __name__ == '__main__':
main()
23 changes: 0 additions & 23 deletions mocap_utils/select_epick_kitchen.py

This file was deleted.

0 comments on commit 741f9c9

Please sign in to comment.