{'fraction_non_alphanumeric': 0.029199929040269648, 'fraction_numerical': 0.011708355508249068, 'mean_word_length': 4.796010692987868, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Motion Capture from Internet Videos

Recent advances in image-based human pose estimation make it possible to capture 3D human motion from a single RGB video. However, the inherent depth ambiguity and self-occlusion in a single view prohibit the recovery of as high-quality motion as multi-view reconstruction. While multi-view videos are not common, the videos of a celebrity performing a specific action are usually abundant on the Internet. Even if these videos were recorded at different time instances, they would encode the same motion characteristics of the person. Therefore, we propose to capture human motion by jointly analyzing these Internet videos instead of using single videos separately. However, this new task poses many new challenges that cannot be addressed by existing methods, as the videos are unsynchronized, the camera viewpoints are unknown, the background scenes are different, and the human motions are not exactly the same among videos. To address these challenges, we propose a novel optimization-based framework and experimentally demonstrate its ability to recover much more precise and detailed motion from multiple videos, compared against monocular motion capture methods.


Introduction
Human motion capture (MoCap) is a core technology in a variety of applications such as movie production, video game development, sports analysis and interactive entertainment. While there have been some commercial solutions to MoCap, e.g., optical MoCap systems like Vicon, these systems are for professionals but not commodities. The systems are expensive and hard to calibrate. More importantly, the performers need to present in the studio to perform actions, which makes it impossible to collect large-scale motion data for a large population. For example, producing an animated avatar of a celebrity needs to invite the person to the MoCap studio, which is not always feasible especially for amateur productions.
To make human MoCap a commodity, many monocular motion capture algorithms [57,24,17,51] have been developed to recover human motion from single RGB videos. Remarkable progress has been made in past years thanks to the  advances in deep learning, public datasets on human bodies, and expressive human models [32,28]. However, all these methods take a single video as input. As 3D reconstruction from a monocular image is inherently ill-posed, it is extremely difficult to recover accurate and detailed motion from a single video. Leveraging multiple views can resolve the ambiguity, but calibrated and synchronized multi-view videos are not common.
Fortunately, we observe that videos of some celebrities doing some specific actions are abundant on the Internet. While those videos were recorded at different times and the motions in these videos are not exactly the same, they encode the same motion characteristics of the person. Compared to a single video, multiple videos provide richer observations about the specific motion. More importantly, the videos are often recorded at different viewpoints which provide multi-view information to help alleviate the 3D ambiguity and self-occlusion issues.
In this paper, we propose to capture human motion from a collection of Internet videos that record different instances of a person's specific performance. However, this new problem brings in many challenges that make existing multiview MoCap algorithms inapplicable: the human motions are not exactly the same among all videos; the videos are unsynchronized; the camera viewpoints are unknown; and the background scenes can be different. To solve these challenges, we propose an optimization-based framework that simultaneously solves video synchronization, camera calibration, and human motion reconstruction. More specifically, the proposed system initializes per-frame 3D human pose estimation with a learned 3D pose estimator, synchronizes videos by matching frames based on the 3D pose similarity, and jointly optimizes for camera poses and human motions over all the videos. The motions to be recovered are not assumed exactly the same among videos but modeled by a low-rank subspace. Finally, the motion reconstruction and the pose-based video synchronization are iteratively refined. We also show that the video synchronization can be improved by imposing the cycle consistency constraint among multiple videos.
In summary, we make the following contributions: -We introduce the new task of motion capture from a collection of Internet videos that record different instances of a person's certain action, which is unexplored in the literature to our knowledge. -We develop a new optimization-based framework to solve this new task. Our technical contributions include pose-based video synchronization, low-rank modeling of motions, and joint optimization for synchronization, camera poses and human motion. -We show that, compared to using single videos, the joint analysis of multiple videos provides richer information to address occlusion and depth ambiguity, even if the videos record different motion instances.

Related work
Single-view Mocap: There has been remarkable progress on 3D human pose and shape estimation from single images. Many works focus on the skeletonbased 3D human pose estimation, either first estimating 2D pose from images and then lifting it to 3D [30,57,7,29,36], or end-to-end regressing to obtain the 3D pose directly [45,42,44,58,33,43]. In addition, a lot of works propose to estimate the 3D pose and shape involving a parametric model of the human body [1,28]. Some early works attempt to use the optimization-based methods [40,16,3,25,53], which fit the human model to 2D evidence. More recently, many works attempt to directly regress the model from images with a deep network [23,31,35,54,24,17,51]. However, due to the inherent depth ambiguity of single views, the accuracy of these methods is not comparable with the multi-view reconstruction.
Multi-view Mocap: Markerless multi-view motion capture has been explored in computer vision for many years. The solutions to this problem are mainly divided into two categories: tracking and pose estimation. Most multi-view tracking methods [15,2,26,27,11] fit a human body model, e.g., a triangle mesh or a collection of geometric primitives, to image evidence such as keypoints and silhouette. The main difference between them is the type of image evidence and the way to optimize it. However, these tracking based approaches usually require the initialization of the first frame and easily fall into local optima and tracking failures. Hence, more recent works [41,4,34,22] generally tend to estimate 3D human body based on 2D features detected from images. Burenius et al. [4] propose to extend the pictorial structure model to 3D and use it to estimate 3D human skeleton from images. Pavlakos et al. [34] propose to use a ConvNet for 2D pose estimation and combine with the 3D pictorial structure model to produce 3D pose estimation. Huang et al. [20] and Joo et al. [22] propose to combine statistical body models with a 2D pose estimator and show impressive results. All the above methods assume the multi-view videos are synchronized with known camera parameters.
There are a few methods [18,12,13,55,49,52,38] which attempt to reconstruct the 3D human motion from multiple uncalibrated and unsynchronized videos. Most methods synchronize the videos using additional information, such as audio [18,12], system time [38], and flashing a light [49], which is unavailable in our scenario. In terms of calibration, many works [18,12,55,49,52] assume that the camera parameters are provided or obtain the camera geometry using structure from motion based on the static background, which is inapplicable in our setting where the scenes are totally different. Some works [13,52] also propose to optimize camera parameters and human poses jointly but they assume the motions among videos are exactly the same.
Video alignment: When the videos are recording the same event, there are many existing methods to address the temporal alignment problem. Early works [6,46,50,47] generally assume a linear temporal mapping between videos. More recent works propose non-linear solutions based on handcrafted features [48] or learned features [39]. However, for our situation where the videos record similar motions rather than the same event, these approaches are not suitable. Dwibedi et al. [10] propose a self-supervised representation learning method for general video alignment but not tailored for human videos. We will use it as a baseline to evaluate our synchronization component in experiments.

Methods
Our goal is to reconstruct human motion from multiple videos. Suppose the videos are synchronized, the cameras are calibrated and the motion is the same in these videos, this problem is reduced to a multi-view 3D pose reconstruction problem, which can be solved by first detecting 2D poses in each view and then lifting them to 3D by triangulation. However, this is not the case in our task, where we need to solve video synchronization and motion reconstruction simultaneously with unknown camera geometry, and the motions are similar but not exactly the same across videos.
To solve this challenging problem, we propose an iterative optimization framework that jointly solves synchronization and reconstruction. The intuition is that, if the 3D pose in each video frame is given, we can synchronize videos based on the 3D poses; and if the videos are synchronized, we can recover 3D poses and camera viewpoints from the corresponding frames using multi-view geometry. Figure 2 presents an overview of our approach. We initialize per-frame 3D poses with a CNN-based estimator and iteratively solve synchronization and motion recovery by optimization. In the rest of this section, we first introduce the pose-based video synchronization and then the motion recovery method.

Pose-based video synchronization
In order to leverage multiple views for pose reconstruction, video synchronization is required, i.e., finding the correspondences of frames between videos. However, this is a challenging task because the appearances are very different among videos due to the different background, clothing, and viewpoints. To address this problem, we propose to synchronize videos directly based on 3D human poses seen in the video frames. The initial poses can be obtained by an off-the-shelf pose estimator [24] and refined after synchronization.
Suppose there are M Internet videos, N j is the number of frames for video j, and K ij ∈ R 3×J denotes the 3D human pose estimated for the i-th frame of video j. Then, we can measure the likelihood that two frames correspond to each other (a.k.a affinity) based on the similarity between the estimated 3D human poses. Specifically, we compute the Euclidean distance between each pair of 3D poses aligned by the Procrustes method. Then, we map the reciprocal of distance to a value between [0, 1] as the affinity score between two frames. For a pair of videos j 1 and j 2 , we construct an affinity matrix A j1j2 ∈ R Nj 1 ×Nj 2 which consists of all affinity scores between frames of two videos. The correspondences to be estimated can be represented as a partial permutation matrix X j1j2 ∈ {0, 1} Nj 1 ×Nj 2 and efficiently estimated based on A j1j2 using an optimal assignment algorithm, e.g., dynamic programming considering the sequential constraint on video frames.
If we align each pair of videos separately, the resulting correspondences may be inconsistent due to ignoring the cycle consistency constraint. For example, as shown in Figure 3, the correspondences in green are cycle-consistent since they form a closed cycle and the ones in red are inconsistent. Therefore, we can use the cycle consistency constraint to improve the alignment of multiple videos. To achieve this, we adopt the result in prior work [19] that the cycle consistency is equivalent to a low-rank constraint on the correspondence matrix X, which is the concatenation of all pairwise permutation matrix: N a is the number of all frames of all videos. Therefore, we minimize the following objective function to estimate X: where A ∈ R Na×Na denotes the concatenation of all A j1j2 similar to the form of X, λ is the weight of low-rank constraint. This problem can be approximately solved with the convex relaxation algorithms in previous work [9,56]. The relaxed solution X j1j2 is usually not a valid permutation matrix but a real matrix with values in (0, 1), which can be regarded as a denoised version of A j1j2 with cycle consistency. Finally, to find the frame-to-frame correspondence between video i and video j, we use the dynamic time warping algorithm based on the affinity matrix X j1j2 .

Motion recovery
Even if the videos are synchronized, the problem still cannot be treated as a standard multi-view reconstruction problem for the following two reasons. First, the relative camera poses between videos are unknown and cannot be recovered from structure from motion as the scenes in videos are different. Second, the motions in all videos are not exactly the same. To solve the first issue, we directly register cameras with the human body as the reference and recovery the human motion and camera parameters simultaneously. To address the second issue, we propose to model the motion variation among videos by a low-rank subspace. Before we introduce the methods in detail, we first introduce the representation of human motion.
Motion representation: For each video, the corresponding 3D human motion is individually represented by a statistical body mesh model SMPL [28] instead of 3D skeleton, since it contains a richer body prior. The SMPL model is parameterized by the pose parameters θ ∈ R 72 , the shape parameters β ∈ R 10 , and a root translation γ ∈ R 3 , and maps a set of parameters to a body mesh denoted by M (θ, β, γ) ∈ R 3×Nv with N v = 6890 vertices. A predefined set of 3D body joints F (θ, β, γ) ∈ R 3×J can be generated by linear regression from the mesh vertices, where J denotes the number of 3D joints. The SMPL+H model [37] which extends SMPL with hands and SMPL-X model [32] which extends SMPL with face and hands can also be used if the video resolution is sufficient for OpenPose [5] to capture the face and hand motion. Our goal is to recover θ ij , β ij , and γ ij , which denote the pose, shape and translation parameters for each frame i of video j, respectively. Note that we assume the shape parameters β ij remains the same in one video, i.e., β ij = β j .

SMPL-BA:
We attempt to solve camera parameters and SMPL parameters simultaneously by minimizing the reprojection errors of body keypoints detected in video frames, similar to bundle adjustment in traditional structure from motion. The body keypoints are anchored on the SMPL model. Therefore, we call this procedure SMPL-BA. Suppose R c j and T c j denote the rotation and translation of the camera j in the world coordinate system that defines SMPL, respectively. Then, the reprojection error in SMPL-BA can be written as: where W ijz ∈ R 2 denotes the z-th joint of the estimated 2D pose at i-th frame in video j with corresponding confidence c ijz and P denotes the perspective projection. ρ denotes the Geman-McClure robust error function for suppressing noisy detection.
In (3), the camera poses R c j and T c j are irrelevant to frame index i. But in practice the camera may move in each video. To address this issue, we assume that the cameras are only allowed to rotate at fixed camera centers, which is a practical assumption, e.g., in sports broadcasting. Then, we propose to compensate for the camera rotation in each video by warping other frames to the first frame using a homography transformation estimated by feature tracking between frames.
Low-rank modeling of motions: When the human motion in each video is not exactly the same, we assume that 3D poses observed in the corresponding frames are very similar which can be approximated by a low-rank matrix: where θ i = [θ T i1 ; θ T i2 ; · · · ; θ T iM ] ∈ R M ×72 denotes the collection of pose parameters in all videos of frame i and the constant s controls the degree of similarity. Note that each video has its own SMPL parameters. The only constraint that links all videos is the low-rank constraint, which is soft and allows difference among videos.
In addition, we also assume that the 3D trajectories of the root joint of the body should be similar among videos. Suppose the root trajectories in all videos are denoted by γ = [γ T 1 ; γ T 2 ; · · · ; γ T M ] ∈ R M ×3N , where γ j ∈ R 3N is the trajectory in video j and N is the number of frames. Then, the constraint can be written as: We set s equal to 1 or 2 empirically in our experiments. When the motion variance across videos is large or even there exist outlier videos, a larger s can be used.
Objective function: Combining all discussed above, the final objective function to optimize can be written as: where L temp is a temporal smoothing term with weight λ t to eliminate jittering in motion: Optimization: To simplify the optimization, we introduce two auxiliary variables Z i ∈ R M ×72 and Y ∈ R M ×3N to decouple the rank constraints with the objective function: where λ r1 and λ r2 are weighting parameters. The problem in (8) is highly nonconvex. However, reliable initialization allows us to use local optimization to solve this problem. Specifically, we update each variable alternately while the others remain fixed. The pose θ i , shape β j , and translation γ parameters of SMPL can be updated with Gradient Descent. It is a standard low-rank approximation problem to update Z i and Y , which can be solved by SVD analytically. The update of R c j and T c j can be solved with a perspective-n-point (PnP) algorithm that minimizes reprojection errors over all frames of video j.
Initialization: We initialize the SMPL parameters for each frame using a pretrained neural network [24], which is further refined by minimizing the reprojection error of 2D keypoints for each frame. Next, the videos are initially synchronized based on the initial pose estimates as introduced in Section 3.1. Then, a reference video is selected, whose camera coordinate system is regarded as the world frame. Note that the initial SMPL model in each video is defined in the coordinate system of the respective camera. Therefore, the relative camera poses between two videos can be initialized by rigidly aligning the SMPL models, assuming the SMPL pose parameters are the same between videos. When intrinsics are unknown, we set the focal length to be a large constant, approximating a weak-perspective camera model. In this way, the camera poses can be initialized.

Iterative optimization
The video synchronization in the first iteration may not be very accurate based on initial pose estimates. Therefore, we propose to refine the synchronization based on the optimized poses. More specifically, the affinity matrix A in Section 3.1 is updated with the optimized poses given by the SMPL-BA and the frame correspondences are re-computed using the new affinity matrix. Then, the SMPL-BA is computed again with the updated synchronization. Both synchronization and reconstruction benefit from each other in iterative optimization, which will be experimentally demonstrated in Section 4.2.

Motion Capture from Internet videos
There is no existing dataset for our task. Therefore, we collect a new dataset that consists of 20 actions of various actors, such as tennis serves, yoga and Tai Chi. Take tennis serves as an example. We download the publicly available videos of some tennis players from YouTube, and manually crop the videos roughly to obtain a set of video clips of serves for each player. Figure 4 shows the statistics of the number of videos and average number of frames for each action. The dataset is available at https://github.com/zju3dv/iMoCap.
We apply the proposed approach on each action of this dataset to recover the corresponding human motion. Some representative results are visualized in Figure 6, which shows that the proposed approach is able to recover 3D human motion as well as camera geometry from these videos, even if they were recorded at different times. These videos record the action from very different viewpoints and therefore provide multi-view constraints to help alleviate the depth ambiguity and self-occlusion issues that often occur for single-view estimation. Consequently, compared to the monocular motion capture algorithm [24], our approach produces much more detailed and faithful motion, as indicated by the circles in Figure 6. In addition, with the multi-view constraint, our method is also able to recover an accurate 3D trajectory of the body as shown   in Figure 5, which is infeasible for monocular motion capture algorithms. Note that, the proposed approach can be easily extended to hand motion recovery if the 2D hand pose estimation is available as shown in Figure 1 and 6 (Tai Chi). We find that most of the failure cases are because of failed 2D pose estimation. Also, when the viewpoints of videos are similar, the depth ambiguity cannot be resolved even if multiple videos are used. More qualitative results and video demonstrations are available in the supplementary material.
Since the motion in all the videos is not exactly the same, each video has its own SMPL parameters with a low-rank constraint to make the parameters correlated among multiple videos. An alternative is to assume the motions are all the same and use a single model with the same set of SMPL parameters for all videos. We provide a qualitative comparison in Figure 7. More specifically, we reproject the initial 3D mesh, the 3D mesh reconstructed by our low-rank model, and the 3D mesh reconstructed by the single model to images and compare them in terms of 2D consistency. The results show that the projected mesh using the single model is less consistent with 2D evidence as shown in the red circles, which suggests that the single model cannot model the motion difference among videos. Low-rank modeling is able to capture more detailed motion, such as the curved back of the performer, as shown in the green circles. Overall, low-rank modeling recovers more detailed and natural motion than the results of a single model and initial monocular results.

Quantitative evaluation
While we have collected a dataset of Internet videos to demonstrate the qualitative performance of our system, quantitative evaluation is difficult due to the lack of 3D ground truth, a similar case for most prior work on reconstruction from Internet data. For quantitative analysis, we synthesize a dataset using existing datasets [21] with ground-truth annotations. We select some challenging sequences in the Human3.6M dataset [21] and modify the data to simulate the unsynchronized and uncalibrated scenario. Please refer to Figure 8 for details. We would like to note that the purpose of evaluation on Human3.6M is not to compare against existing methods in the standard Human3.6M setting, but to provide an ablative analysis of our system when solving the proposed problem.
Video synchronization: As described in section 3.1, we propose a posebased video synchronization method to address the different appearances among videos, i.e., background, clothing, and viewpoints. We also impose the cycle consistency constraint to improve the synchronization. Here, we compete with some baselines and we use the standard video alignment metric to measure the alignment of two videos. In particular, for each frame of non-reference video v i , we compute the frame distance between the matched frame and the ground truth position in reference video v 0 and normalize it by the video clip length. We first propose a simple alternative to use the DP algorithm to quantize the original affinity matrix directly. The result of this baseline method ('No cycleconsis') is shown in Table 1. The results show that imposing the cycle consistency constraint can reduce the alignment error of video synchronization significantly. Another baseline is a recent self-supervised representation learning method [10] based on the cycle consistency loss to align videos. Their network is retrained on the evaluated sequences and the alignments are obtained by the dynamic time warping algorithm on the features. The results of their method ('TCC') on the dataset are presented in Table 1. The results show that our 3D pose based method outperforms the generic method by a large margin in our case.  Fig. 8: Dataset generation for quantitative analysis. We edit the videos in Hu-man3.6M to simulate the unsynchronized scenario. As the dataset is large, we only select a few actions, i.e., SittingDown, Sitting, Smoking, Photo and Phoning. For each action, we first sample Ns1 frames at equal intervals (blue lines) from each video, which results in Ns1 − 1 segments. Then we randomly choose Ns2 segments and randomly sample Ns3 frames (red lines) from each selected segment. In our experiments, we set Ns1 = 150, Ns2 = 50 and for each segment Ns3 is a variable value randomly selected from 1 to the length of the segment. The dataset is available at https://github.com/zju3dv/iMoCap. position error (MPJPE) and the error after rigid alignment with the ground truth (P-MPJPE). As videos are unsynchronized and uncalibrated, none of the existing multiview MoCap methods is applicable to the proposed problem. Monocular MoCap methods are the only applicable alternatives. We compare with the state-ofthe-art monocular method HMMR [24] and the results are shown in Table 2. Our method significantly reduces the reconstruction error compared to HMMR, which shows the benefit of using multiple videos.
Note that we use a generic 2D pose detector [14] which is not fine-tuned on Human3.6M. With no fine-tuning, we wish to evaluate the generalization ability of our system when applied to unseen and challenging videos. We also report the results with a fine-tuned 2D pose detector [8] in Table 2, which show that using a fine-tuned detector significantly reduces the reconstruction error.
In addition, we validate the influence of the number of videos. We report the reconstruction accuracy with various numbers of videos in Table 2. The results show that more videos improve the accuracy of reconstructed motion. As for Internet videos, while more views generally improve the results, we empirically find that three or four videos are sufficient in most cases.
Iterative optimization: Our approach iteratively optimizes video synchronization and reconstruction to let them benefit from each other. 'No iter-opt' in Table 2: Quantitative analysis of reconstruction. 'HMMR' denotes the state-ofthe-art monocular motion capture method [24].   Table 3 indicates the result without such an iterative optimization, which shows that iterative optimization reduces both alignment and reconstruction errors.

Summary
In this paper, we demonstrated the potential of leveraging multiple Internet videos to recover accurate and detailed human motion, which in a long-term perspective opens up the possibility of collecting high-quality and diverse human motion data for free from existing Internet videos. Unlike standard multiview motion capture, in this new task the human motions are not exactly the same among all videos; the videos are unsynchronized; the camera viewpoints are unknown; and the background scenes can be different. All these challenges make existing multi-view motion capture algorithms inapplicable. To address all challenges above, we proposed (1) low-rank modeling of motions to handle motion variation among videos; (2) pose-based multi-video synchronization and calibration; and (3) most importantly a unified optimization-based framework to solve the entire problem, which doesn't treat synchronization, calibration and motion recovery as separate tasks, but integrates them in a single optimization problem. Both qualitative and quantitative results demonstrated the effectiveness of the proposed approach. Please see the supplementary material for more video demonstrations.