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
* @Author: Qing Shuai
* @LastEditors: Qing Shuai
* @LastEditTime: 2021-01-25 19:35:14
* @LastEditTime: 2021-01-29 19:50:10
* @FilePath: /EasyMocapRelease/Readme.md
-->
# 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!
1. [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)
1. [[CVPR19] Multi-Person from Multiple Views](https://github.com/zju3dv/mvpose)
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/)
## Installation

View File

@ -2,7 +2,7 @@
@ Date: 2021-01-15 11:12:00
@ Author: 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
'''
import time
@ -18,4 +18,4 @@ class Timer:
def __exit__(self, exc_type, exc_value, exc_tb):
end = time.time()
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
@ Author: 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
'''
import os, sys
@ -145,8 +145,8 @@ def detect_frame(detector, img, pid=0):
annots.append(annot)
return annots
def extract_yolo_hrnet(image_root, annot_root):
imgnames = sorted(glob(join(image_root, '*.jpg')))
def extract_yolo_hrnet(image_root, annot_root, ext='jpg'):
imgnames = sorted(glob(join(image_root, '*.{}'.format(ext))))
import torch
device = torch.device('cuda')
from estimator.detector import Detector
@ -170,7 +170,7 @@ def extract_yolo_hrnet(image_root, annot_root):
}
detector = Detector('yolo', 'hrnet', device, config)
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)
img0 = cv2.imread(imgname)
annot['annots'] = detect_frame(detector, img0, 0)
@ -188,6 +188,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('path', type=str, default=None)
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('--openpose', type=str,
default='/media/qing/Project/openpose')
@ -226,6 +227,6 @@ if __name__ == "__main__":
dst=annot_root
)
elif mode == 'yolo-hrnet':
extract_yolo_hrnet(image_root, annot_root)
extract_yolo_hrnet(image_root, annot_root, args.ext)
else:
print(args.path, ' not exists')