Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/ChrisWu1997/2D-Motion-Retargeting
14 May 2026, 11:01:37 UTC
  • Code
  • Branches (3)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/dependabot/pip/numpy-1.22.0
    • refs/heads/dependabot/pip/opencv-python-4.2.0.32
    • refs/heads/master
    No releases to show
  • 637d1ac
  • /
  • common.py
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:94ff75d11b96ba6954263ad8bf3d343318d48a37
origin badgedirectory badge
swh:1:dir:637d1ac097844dea721fef398b465bba6cad6c0e
origin badgerevision badge
swh:1:rev:f3454a1972a98b3a572f83c1c9ea0b0e5d9e7d00
origin badgesnapshot badge
swh:1:snp:731706168a0a29b22cb97c2f8a1809d2c7d69079

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: f3454a1972a98b3a572f83c1c9ea0b0e5d9e7d00 authored by Rundi Wu on 28 December 2020, 02:08:07 UTC
Update README.md
Tip revision: f3454a1
common.py
import os
from functional import utils
import torch
import numpy as np


class Config:
    name = None
    device = None

    # data paths
    data_dir = './mixamo_data'
    meanpose_path = None
    stdpose_path = None

    # training paths
    save_dir = './train_log'
    exp_dir = None
    log_dir = None
    model_dir = None

    # data info
    img_size = (512, 512)
    unit = 128
    nr_joints = 15
    len_joints = 2 * nr_joints - 2
    view_angles = [(0, 0, -np.pi / 2),
                   (0, 0, -np.pi / 3),
                   (0, 0, -np.pi / 6),
                   (0, 0, 0),
                   (0, 0, np.pi / 6),
                   (0, 0, np.pi / 3),
                   (0, 0, np.pi / 2)]

    # network channels
    mot_en_channels = None
    body_en_channels = None
    view_en_channels = None
    de_channels = None

    # training settings
    use_triplet = True
    triplet_margin = 1
    triplet_weight = 1
    use_footvel_loss = False
    foot_idx = [20, 21, 26, 27]
    footvel_loss_weight = 0.1

    nr_epochs = 300
    batch_size = 64
    num_workers = 4
    lr = 1e-3

    save_frequency = 50
    val_frequency = 100
    visualize_frequency = 500

    def initialize(self, args):
        self.name = args.name if hasattr(args, 'name') else 'full'
        self.use_triplet = not args.disable_triplet if hasattr(args, 'disable_triplet') else None
        self.use_footvel_loss = args.use_footvel_loss if hasattr(args, 'use_footvel_loss') else None

        os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu_ids)
        self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

        self.exp_dir = os.path.join(self.save_dir, 'exp_' + self.name)
        self.log_dir = os.path.join(self.exp_dir, 'log/')
        self.model_dir = os.path.join(self.exp_dir, 'model/')
        utils.ensure_dirs([self.log_dir, self.model_dir])

        if self.name == 'skeleton':
            self.mot_en_channels = [self.len_joints + 2, 64, 96, 128]
            self.body_en_channels = [self.len_joints, 32, 48, 64]
            self.de_channels = [self.mot_en_channels[-1] + self.body_en_channels[-1], 128, 64, self.len_joints + 2]
            self.view_angles = None

            self.meanpose_path = './mixamo_data/meanpose.npy'
            self.stdpose_path = './mixamo_data/stdpose.npy'
        elif self.name == 'view':
            self.mot_en_channels = [self.len_joints + 2, 64, 96, 128]
            self.view_en_channels = [self.len_joints, 64, 96, 128, 32]
            self.de_channels = [self.mot_en_channels[-1] + self.view_en_channels[-1], 128, 64, self.len_joints + 2]

            self.meanpose_path = './mixamo_data/meanpose_with_view.npy'
            self.stdpose_path = './mixamo_data/stdpose_with_view.npy'
        else:
            self.mot_en_channels = [self.len_joints + 2, 64, 96, 128]
            self.body_en_channels = [self.len_joints, 32, 48, 64, 16]
            self.view_en_channels = [self.len_joints, 32, 48, 64, 8]
            self.de_channels = [self.mot_en_channels[-1] + self.body_en_channels[-1] + self.view_en_channels[-1],
                                128, 64, self.len_joints + 2]

            self.meanpose_path = './mixamo_data/meanpose_with_view.npy'
            self.stdpose_path = './mixamo_data/stdpose_with_view.npy'


config = Config()

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API