update Readme

This commit is contained in:
shuaiqing 2021-01-29 21:30:29 +08:00
parent ceba363dcb
commit 45e8235055
4 changed files with 12 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* @Date: 2021-01-13 20:32:12 * @Date: 2021-01-13 20:32:12
* @Author: Qing Shuai * @Author: Qing Shuai
* @LastEditors: Qing Shuai * @LastEditors: Qing Shuai
* @LastEditTime: 2021-01-25 19:35:14 * @LastEditTime: 2021-01-29 19:50:10
* @FilePath: /EasyMocapRelease/Readme.md * @FilePath: /EasyMocapRelease/Readme.md
--> -->
# EasyMocap # EasyMocap
@ -16,8 +16,9 @@ In this project, we provide the basic code for fitting SMPL[1]/SMPL+H[2]/SMPLX[3
> We plan to intergrate more interesting algorithms, please stay tuned! > We plan to intergrate more interesting algorithms, please stay tuned!
1. [Multi-Person from Multiple Views](https://github.com/zju3dv/mvpose) 1. [[CVPR19] Multi-Person from Multiple Views](https://github.com/zju3dv/mvpose)
2. [Mocap from Multiple **Uncalibrated** and **Unsynchronized** Videos](https://arxiv.org/pdf/2008.07931.pdf) 2. [[ECCV20] Mocap from Multiple **Uncalibrated** and **Unsynchronized** Videos](https://arxiv.org/pdf/2008.07931.pdf)
![](doc/imocap/frame_00036_036.jpg)
3. [Dense Reconstruction and View Synthesis from **Sparse Views**](https://zju3dv.github.io/neuralbody/) 3. [Dense Reconstruction and View Synthesis from **Sparse Views**](https://zju3dv.github.io/neuralbody/)
## Installation ## Installation

View File

@ -2,7 +2,7 @@
@ Date: 2021-01-15 11:12:00 @ Date: 2021-01-15 11:12:00
@ Author: Qing Shuai @ Author: Qing Shuai
@ LastEditors: Qing Shuai @ LastEditors: Qing Shuai
@ LastEditTime: 2021-01-15 11:19:55 @ LastEditTime: 2021-01-25 21:36:42
@ FilePath: /EasyMocap/code/mytools/utils.py @ FilePath: /EasyMocap/code/mytools/utils.py
''' '''
import time import time
@ -18,4 +18,4 @@ class Timer:
def __exit__(self, exc_type, exc_value, exc_tb): def __exit__(self, exc_type, exc_value, exc_tb):
end = time.time() end = time.time()
if not self.silent: if not self.silent:
print('-> [{}]: {:.2f}s'.format(self.name, end-self.start)) print('-> [{:20s}]: {:5.1f}ms'.format(self.name, (end-self.start)*1000))

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

View File

@ -2,7 +2,7 @@
@ Date: 2021-01-13 20:38:33 @ Date: 2021-01-13 20:38:33
@ Author: Qing Shuai @ Author: Qing Shuai
@ LastEditors: Qing Shuai @ LastEditors: Qing Shuai
@ LastEditTime: 2021-01-25 14:41:56 @ LastEditTime: 2021-01-27 10:41:48
@ FilePath: /EasyMocap/scripts/preprocess/extract_video.py @ FilePath: /EasyMocap/scripts/preprocess/extract_video.py
''' '''
import os, sys import os, sys
@ -145,8 +145,8 @@ def detect_frame(detector, img, pid=0):
annots.append(annot) annots.append(annot)
return annots return annots
def extract_yolo_hrnet(image_root, annot_root): def extract_yolo_hrnet(image_root, annot_root, ext='jpg'):
imgnames = sorted(glob(join(image_root, '*.jpg'))) imgnames = sorted(glob(join(image_root, '*.{}'.format(ext))))
import torch import torch
device = torch.device('cuda') device = torch.device('cuda')
from estimator.detector import Detector from estimator.detector import Detector
@ -170,7 +170,7 @@ def extract_yolo_hrnet(image_root, annot_root):
} }
detector = Detector('yolo', 'hrnet', device, config) detector = Detector('yolo', 'hrnet', device, config)
for nf, imgname in enumerate(tqdm(imgnames)): for nf, imgname in enumerate(tqdm(imgnames)):
annotname = join(annot_root, os.path.basename(imgname).replace('.jpg', '.json')) annotname = join(annot_root, os.path.basename(imgname).replace('.{}'.format(ext), '.json'))
annot = create_annot_file(annotname, imgname) annot = create_annot_file(annotname, imgname)
img0 = cv2.imread(imgname) img0 = cv2.imread(imgname)
annot['annots'] = detect_frame(detector, img0, 0) annot['annots'] = detect_frame(detector, img0, 0)
@ -188,6 +188,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('path', type=str, default=None) parser.add_argument('path', type=str, default=None)
parser.add_argument('--mode', type=str, default='openpose', choices=['openpose', 'yolo-hrnet']) parser.add_argument('--mode', type=str, default='openpose', choices=['openpose', 'yolo-hrnet'])
parser.add_argument('--ext', type=str, default='jpg', choices=['jpg', 'png'])
parser.add_argument('--handface', action='store_true') parser.add_argument('--handface', action='store_true')
parser.add_argument('--openpose', type=str, parser.add_argument('--openpose', type=str,
default='/media/qing/Project/openpose') default='/media/qing/Project/openpose')
@ -226,6 +227,6 @@ if __name__ == "__main__":
dst=annot_root dst=annot_root
) )
elif mode == 'yolo-hrnet': elif mode == 'yolo-hrnet':
extract_yolo_hrnet(image_root, annot_root) extract_yolo_hrnet(image_root, annot_root, args.ext)
else: else:
print(args.path, ' not exists') print(args.path, ' not exists')