repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin64/osmbundler/matching/__init__.py
osm-bundler/osm-bundlerWin64/osmbundler/matching/__init__.py
__all__ = ["bundler", "manual"]
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin64/osmbundler/matching/manual.py
osm-bundler/osm-bundlerWin64/osmbundler/matching/manual.py
from engine import MatchingEngine className = "ManualMatching" class ManualMatching(MatchingEngine): featureExtractionNeeded = False def __init__(self): pass def match(self): pass
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin64/osmbundler/matching/engine.py
osm-bundler/osm-bundlerWin64/osmbundler/matching/engine.py
class MatchingEngine(): outputFileName = "matches.init.txt" featureExtractionNeeded = True def __init__(self): pass def match(self): pass
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin64/osmcmvs/__init__.py
osm-bundler/osm-bundlerWin64/osmcmvs/__init__.py
import logging import sys, os, getopt, tempfile, subprocess, shutil # service function: get path of an executable (.exe suffix is added if we are on Windows) def getExecPath(dir, fileName): if sys.platform == "win32": fileName = "%s.exe" % fileName return os.path.join(dir, fileName) distrPath = os.path.di...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/RunCMVS.py
osm-bundler/osm-bundlerWin32/RunCMVS.py
import logging import osmcmvs logging.basicConfig(level=logging.INFO, format="%(message)s") # initialize OsmCMVS manager class manager = osmcmvs.OsmCmvs() # initialize PMVS input from Bundler output manager.doBundle2PMVS() # call PMVS manager.doCMVS()
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/RunBundler.py
osm-bundler/osm-bundlerWin32/RunBundler.py
import logging import osmbundler logging.basicConfig(level=logging.INFO, format="%(message)s") # initialize OsmBundler manager class manager = osmbundler.OsmBundler() manager.preparePhotos() manager.matchFeatures() manager.doBundleAdjustment() manager.openResult()
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/RunPMVS.py
osm-bundler/osm-bundlerWin32/RunPMVS.py
import logging import osmpmvs logging.basicConfig(level=logging.INFO, format="%(message)s") # initialize OsmPMVS manager class manager = osmpmvs.OsmPmvs() # initialize PMVS input from Bundler output manager.doBundle2PMVS() # call PMVS manager.doPMVS()
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmpmvs/__init__.py
osm-bundler/osm-bundlerWin32/osmpmvs/__init__.py
import logging import sys, os, getopt, tempfile, subprocess, shutil # service function: get path of an executable (.exe suffix is added if we are on Windows) def getExecPath(dir, fileName): if sys.platform == "win32": fileName = "%s.exe" % fileName return os.path.join(dir, fileName) distrPath = os.path.di...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/defaults.py
osm-bundler/osm-bundlerWin32/osmbundler/defaults.py
maxPhotoDimension = 1200 matchingEngine = "bundler" featureExtractor = "siftvlfeat" bundlerOptions = ( "--match_table matches.init.txt\n", "--output bundle.out\n", "--output_all bundle_\n", "--output_dir bundle\n", "--variable_focal_length\n", "--use_focal_estimate\n", "--constrain_focal\n", "--constrain_focal_weight...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/__init__.py
osm-bundler/osm-bundlerWin32/osmbundler/__init__.py
import logging import sys, os, getopt, tempfile, subprocess import sqlite3 from PIL import Image from PIL.ExifTags import TAGS import defaults import matching from matching import * import features from features import * # a helper function to get list of photos from a directory def getPhotosFromDirectory(photoDir...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/features/extractor.py
osm-bundler/osm-bundlerWin32/osmbundler/features/extractor.py
class FeatureExtractor(): def __init__(self, distrDir): pass def extract(self, photo, photoInfo): pass
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/features/sift.py
osm-bundler/osm-bundlerWin32/osmbundler/features/sift.py
import sys, os, logging from extractor import FeatureExtractor class Sift(FeatureExtractor): fileExtension = "key" executable = '' win32Executable = '' linuxExecutable = '' def __init__(self, distrDir): if sys.platform == "win32": self.executable = os.path.join(d...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/features/siftvlfeat.py
osm-bundler/osm-bundlerWin32/osmbundler/features/siftvlfeat.py
import os, subprocess, gzip, logging from sift import Sift className = "VlfeatSift" class VlfeatSift(Sift): win32Executable = "vlfeat/bin/w32/sift.exe" linuxExecutable = "vlfeat/bin/glx/sift" def __init__(self, distrDir): Sift.__init__(self, distrDir) def extract(self, photo, photoInfo)...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/features/__init__.py
osm-bundler/osm-bundlerWin32/osmbundler/features/__init__.py
__all__ = ["siftvlfeat", "siftlowe"]
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/features/siftlowe.py
osm-bundler/osm-bundlerWin32/osmbundler/features/siftlowe.py
import os, subprocess, gzip from sift import Sift className = "LoweSift" class LoweSift(Sift): win32Executable = "sift-lowe/siftWin32.exe" linuxExecutable = "sift-lowe/sift" def __init__(self, distrDir): Sift.__init__(self, distrDir) def extract(self, photo, photoInfo): phot...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/matching/bundler.py
osm-bundler/osm-bundlerWin32/osmbundler/matching/bundler.py
import sys,os,subprocess,logging from engine import MatchingEngine className = "BundlerMatching" class BundlerMatching(MatchingEngine): featuresListFileName = "list_features.txt" executable = '' def __init__(self, distrDir): if sys.platform == "win32": self.executable = os.path.jo...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/matching/__init__.py
osm-bundler/osm-bundlerWin32/osmbundler/matching/__init__.py
__all__ = ["bundler", "manual"]
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/matching/manual.py
osm-bundler/osm-bundlerWin32/osmbundler/matching/manual.py
from engine import MatchingEngine className = "ManualMatching" class ManualMatching(MatchingEngine): featureExtractionNeeded = False def __init__(self): pass def match(self): pass
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmbundler/matching/engine.py
osm-bundler/osm-bundlerWin32/osmbundler/matching/engine.py
class MatchingEngine(): outputFileName = "matches.init.txt" featureExtractionNeeded = True def __init__(self): pass def match(self): pass
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
lyletang/Huawei_LiteOS
https://github.com/lyletang/Huawei_LiteOS/blob/87d4fb9ea485e43587e1618e31fead8a41a1ad38/osm-bundler/osm-bundlerWin32/osmcmvs/__init__.py
osm-bundler/osm-bundlerWin32/osmcmvs/__init__.py
import logging import sys, os, getopt, tempfile, subprocess, shutil # service function: get path of an executable (.exe suffix is added if we are on Windows) def getExecPath(dir, fileName): if sys.platform == "win32": fileName = "%s.exe" % fileName return os.path.join(dir, fileName) distrPath = os.path.di...
python
MIT
87d4fb9ea485e43587e1618e31fead8a41a1ad38
2026-01-05T07:08:48.607958Z
false
CQCumbers/kle_render
https://github.com/CQCumbers/kle_render/blob/a14ccea8e46286ba01c10e3380eca0a963e21d5d/key.py
key.py
import functools, io, math, requests from PIL import Image, ImageMath, ImageColor, ImageCms from PIL import ImageDraw, ImageFont, ImageOps from colormath import color_objects, color_conversions class Key: __slots__ = [ 'x', 'y', 'width', 'height', 'x2', 'y2', 'width2', 'height2', 'rotation_angle',...
python
MIT
a14ccea8e46286ba01c10e3380eca0a963e21d5d
2026-01-05T07:10:11.873864Z
false
CQCumbers/kle_render
https://github.com/CQCumbers/kle_render/blob/a14ccea8e46286ba01c10e3380eca0a963e21d5d/keyboard.py
keyboard.py
import copy, html, lxml.html, re, json, requests, tinycss2 from PIL import Image, ImageColor, ImageDraw, ImageFont from key import Key class Keyboard: __slots__ = ['keys', 'keyboard', 'max_size', 'color'] def __init__(self, json): # parse keyboard-layout-editor JSON format data = deserialise...
python
MIT
a14ccea8e46286ba01c10e3380eca0a963e21d5d
2026-01-05T07:10:11.873864Z
false
CQCumbers/kle_render
https://github.com/CQCumbers/kle_render/blob/a14ccea8e46286ba01c10e3380eca0a963e21d5d/config.py
config.py
import os SWAGGER_UI_DOC_EXPANSION = 'full' SWAGGER_UI_JSONEDITOR = True DEBUG = False CORS_HEADERS = 'Content-Type' CORS_RESOURCES = r'/api/*' WTF_CSRF_ENABLED = False SECRET_KEY = os.environ.get('SECRET_KEY') API_TOKEN = os.environ.get('API_TOKEN')
python
MIT
a14ccea8e46286ba01c10e3380eca0a963e21d5d
2026-01-05T07:10:11.873864Z
false
CQCumbers/kle_render
https://github.com/CQCumbers/kle_render/blob/a14ccea8e46286ba01c10e3380eca0a963e21d5d/test.py
test.py
from timeit import default_timer as timer from keyboard import Keyboard, deserialise import json, github, dotenv, os dotenv_path = os.path.join(os.path.dirname(__file__), '.env') dotenv.load_dotenv(dotenv_path) gist_id = '4de8adb88cb4c45c2f43' g = github.Github(os.environ.get('API_TOKEN')) files = [v for k, v in g.ge...
python
MIT
a14ccea8e46286ba01c10e3380eca0a963e21d5d
2026-01-05T07:10:11.873864Z
false
CQCumbers/kle_render
https://github.com/CQCumbers/kle_render/blob/a14ccea8e46286ba01c10e3380eca0a963e21d5d/app.py
app.py
import json, github, io, flask_wtf, flask_wtf.file, wtforms, flask_cors from flask import Flask, Blueprint, send_file, render_template, flash, Markup from flask_restx import Api, Resource from keyboard import Keyboard app = Flask(__name__) app.config.from_object('config') flask_cors.CORS(app) github_api = github.Gith...
python
MIT
a14ccea8e46286ba01c10e3380eca0a963e21d5d
2026-01-05T07:10:11.873864Z
false
CQCumbers/kle_render
https://github.com/CQCumbers/kle_render/blob/a14ccea8e46286ba01c10e3380eca0a963e21d5d/images/script.py
images/script.py
from PIL import Image, ImageDraw import os u = 200 transparent_area = (0,u,int(0.25*u),int(2*u)) # transparent_area = (0, 0, int(0.75*u), u) for fn in os.listdir('.'): # if os.path.isfile(fn) and fn.startswith('GMK_ISO'): # if os.path.isfile(fn) and fn.startswith('GMK_BIGENTER'): if os.path.isfile(fn) and...
python
MIT
a14ccea8e46286ba01c10e3380eca0a963e21d5d
2026-01-05T07:10:11.873864Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/setup.py
setup.py
"""Build script for the IDA Pro sigmaker Cython module. This ``setup.py`` detects the host platform and architecture in order to select appropriate compilation and linkage flags. The build expects the IDA SDK to be installed and accessible via the environment variable ``IDA_SDK``. """ import functools import os impor...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/src/sigmaker/__init__.py
src/sigmaker/__init__.py
""" sigmaker.py - IDA Python Signature Maker https://github.com/mahmoudimus/ida-sigmaker by @mahmoudimus (Mahmoud Abdelkader) """ from __future__ import annotations import contextlib import contextvars import dataclasses import enum import functools import logging import os import pathlib import re import string imp...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
true
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/src/sigmaker/_speedups/__init__.py
src/sigmaker/_speedups/__init__.py
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/tests/integration_test_sigmaker.py
tests/integration_test_sigmaker.py
import logging import pathlib import shutil import sys import tempfile import unittest import warnings sys.path.insert(0, pathlib.Path(__file__).parent.as_posix()) # Import the base test case from coveredtestcase import CoverageTestCase logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # Context m...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/tests/coveredtestcase.py
tests/coveredtestcase.py
""" base_test_case.py - Base test case with coverage support Provides a base class for test cases that automatically handles coverage collection. Subclasses can configure the coverage data file via the coverage_data_file class variable. """ import unittest import coverage class CoverageTestCase(unittest.TestCase):...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/tests/__init__.py
tests/__init__.py
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/tests/unit_test_sigmaker.py
tests/unit_test_sigmaker.py
""" unit_test_sigmaker.py - Unit tests for sigmaker Tests the sigmaker module and related functionality with mocked system interfaces to ensure reliable testing across different platforms and architectures. """ import array import gc import itertools import logging import pathlib import platform import random import ...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
true
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/tests/performance_test.py
tests/performance_test.py
import array import gc import logging import pathlib import shutil import sys import tempfile import time import unittest import unittest.mock import warnings # Context manager to suppress warnings from IDA Pro modules during import with warnings.catch_warnings(): warnings.filterwarnings( "ignore", categor...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
mahmoudimus/ida-sigmaker
https://github.com/mahmoudimus/ida-sigmaker/blob/5d645fa34b5892dc86c5a0ae5626f994ceb96f1e/tests/_resources/build_test_binary.py
tests/_resources/build_test_binary.py
#!/usr/bin/env python3 """ Build script for test binary using NASM """ import os import platform import subprocess import sys from pathlib import Path def run_command(cmd, cwd=None): """Run a command and return True if successful""" try: result = subprocess.run( cmd, shell=True, cwd=cwd, c...
python
MIT
5d645fa34b5892dc86c5a0ae5626f994ceb96f1e
2026-01-05T07:10:29.489005Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/live_server.py
live_server.py
import time import torch import numpy as np from pygame.time import Clock import utils import socket import articulate as art from net.sig_mp import Net import config # define configs device = "cuda" if torch.cuda.is_available() else "cpu" body_model = art.ParametricModel(config.paths.smpl_file) server_ip = '127.0.0.1...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/live_demo_sync.py
live_demo_sync.py
from queue import Queue import cv2 import time import socket import threading import numpy as np import torch from pygame.time import Clock import articulate as art from articulate.utils.print import * import select import os import atexit from articulate.utils.bullet import RotationViewer class SyncIMUCam: def _...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/live_detector.py
live_detector.py
import time import torch import numpy as np import cv2 from pygame.time import Clock import utils from live_demo_sync import SyncIMUCam import socket import articulate as art import config import mediapipe as mp # define configs body_model = art.ParametricModel(config.paths.smpl_file) K = torch.tensor(config.Live.came...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/utils.py
utils.py
import cv2 import numpy as np import tqdm import torch import config mp_mask = torch.tensor(config.mp_mask) def view_2d_keypoint(keypoints, parent=None, images=None, thickness=None, fps=60): r""" View 2d keypoint sequence in image coordinate frame. Modified from vctoolkit.render_bones_from_uv. Notes ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/config.py
config.py
class paths: smpl_file = 'models/SMPL_male.pkl' smpl_file_f = 'models/SMPL_female.pkl' aist_raw_dir = 'D:/_dataset/AIST/' # e.g., keypoints2d, motions, cameras, splits, video aist_dir = 'data/dataset_work/AIST/' aist_tip_dir = 'data/dataset_work/AIST/tip' amass_raw_dir = 'D:/_dataset/AMASS/' ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/evaluate.py
evaluate.py
import torch from torch.utils.data import DataLoader import articulate as art import config from articulate.utils.torch import * from articulate.utils.print import * from config import * import tqdm import numpy as np import utils import os from net.smplify.run import smplify_runner import cv2 device = torch.device('c...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/preprocess.py
preprocess.py
import articulate as art import torch import os import config from config import * import pickle import tqdm import json import glob import numpy as np import cv2 extkp_mask = torch.tensor(list(HUMBIBody33.extended_keypoints.values())) # reference https://google.github.io/mediapipe/solutions/pose body_model = art.Par...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
true
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/scripts/run_tc_detector.py
scripts/run_tc_detector.py
import cv2 import os import torch import mediapipe as mp import config # define your own path device = "cuda" if torch.cuda.is_available() else "cpu" video_path = os.path.join(config.paths.totalcapture_raw_dir, 'video2') pt_path = os.path.join(config.paths.totalcapture_raw_dir, 'kp2d_mp') mp_detector = mp.solutions.po...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/scripts/smooth_bbox.py
scripts/smooth_bbox.py
# This script is borrowed from https://github.com/akanazawa/human_dynamics/blob/master/src/util/smooth_bbox.py # Adhere to their licence to use this script import numpy as np import scipy.signal as signal from scipy.ndimage.filters import gaussian_filter1d def get_smooth_bbox_params(kps, vis_thresh=2, kernel_size=11...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/scripts/run_aist_detector.py
scripts/run_aist_detector.py
import cv2 import numpy as np import os import time import glob import torch import config from tqdm import tqdm from aist_plusplus.loader import AISTDataset import utils import os import mediapipe as mp import scripts.occlusion as occlusion import random mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/scripts/occlusion.py
scripts/occlusion.py
# -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who is...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/scripts/run_3dpwocc_detector.py
scripts/run_3dpwocc_detector.py
import cv2 import numpy as np import os import torch from tqdm import tqdm import mediapipe as mp import config import utils import pickle from smooth_bbox import get_smooth_bbox_params from config import Pw3d_data device = "cuda" if torch.cuda.is_available() else "cpu" pt_path = os.path.join(config.paths.pw3d_raw_dir...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/scripts/run_3dpw_detector.py
scripts/run_3dpw_detector.py
import cv2 import numpy as np import os import torch from tqdm import tqdm import mediapipe as mp import config import pickle from scripts.smooth_bbox import get_smooth_bbox_params device = "cuda" if torch.cuda.is_available() else "cpu" pt_path = os.path.join(config.paths.pw3d_raw_dir, 'kp2d_mp') mp_detector = mp.solu...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/net/sig_mp.py
net/sig_mp.py
import os if __name__ == '__main__': import sys os.chdir('..') sys.path.insert(0, os.getcwd()) import torch import articulate as art from articulate.utils.torch import * from config import * from torch.nn.functional import relu from torch.utils.data import DataLoader, ConcatDataset import tqdm from articu...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
true
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/net/smplify/run.py
net/smplify/run.py
import torch import articulate as art from .temporal_smplify import TemporalSMPLify device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') def smplify_runner( pred_pose, pred_tran, j2dc, imu_ori, batch_size, cam_k, lr=1.0, opt_steps=1, ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/net/smplify/temporal_smplify.py
net/smplify/temporal_smplify.py
# This script is the extended version of https://github.com/nkolot/SPIN/blob/master/smplify/smplify.py to deal with # sequences inputs. import os import smplx import torch import config # For the GMM prior, we use the GMM implementation of SMPLify-X # https://github.com/vchoutas/smplify-x/blob/master/smplifyx/prior....
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/net/smplify/prior.py
net/smplify/prior.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import sys import os import time import pickle import numpy as np import torch import torch.nn as nn DEFAULT_DTYPE = torch.float32 def create_prior(prior_type, **kwargs): if prior_type == 'gmm': ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/net/smplify/losses.py
net/smplify/losses.py
# This script is borrowed from https://github.com/nkolot/SPIN/. import torch import articulate as art def gmof(x, sigma): """ Geman-McClure error function """ x_squared = x ** 2 sigma_squared = sigma ** 2 return (sigma_squared * x_squared) / (sigma_squared + x_squared) def angle_prior(pose):...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/model.py
articulate/model.py
r""" SMPL/MANO/SMPLH parametric model. Modified from https://github.com/CalciferZh/SMPL. """ __all__ = ['ParametricModel'] import os import pickle import torch import tqdm import numpy as np from . import math as M class ParametricModel: r""" SMPL/MANO/SMPLH parametric model. """ def __init__(...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/filter.py
articulate/filter.py
r""" Temporal filters. """ __all__ = ['LowPassFilter', 'LowPassFilterRotation', 'KalmanFilter'] from . import math as M import quaternion # package: numpy-quaternion import torch class KalmanFilter: r""" https://zhuanlan.zhihu.com/p/113685503 """ def __init__(self, F, H, B, Q=None, R=None,...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/evaluator.py
articulate/evaluator.py
r""" Basic evaluators, and evaluators that measure differences between poses/trans of MANO/SMPL/SMPLH model. """ __all__ = ['BinaryConfusionMatrixEvaluator', 'BinaryClassificationErrorEvaluator', 'PositionErrorEvaluator', 'RotationErrorEvaluator', 'PerJointErrorEvaluator', 'MeanPerJointErrorEvaluator',...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/__init__.py
articulate/__init__.py
r""" Toolkit for articulated body system. """ from .armature import * from .evaluator import * from .model import * # from .filter import * from .renderer import * from . import math
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/renderer.py
articulate/renderer.py
""" SMPL Renderer. Borrowed from VIBE and ROMP. """ __all__ = ['Renderer'] import trimesh import pyrender import numpy as np import pickle class Renderer: def __init__(self, resolution=(224, 224), official_model_file=None): """ Renderer for SMPL model. :param resolution: image resolu...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/armature.py
articulate/armature.py
r""" Joint definition of SMPL/MANO/SMPLH parametric model. """ __all__ = ['MANOJoint', 'SMPLJoint', 'SMPLHJoint'] import enum class MANOJoint(enum.Enum): r""" W = wrist; I = index; M = middle; L = little; R = ring; T = thumb. """ W = 0 ROOT = 0 I0 = 1 I1 = 2 I2 = 3 M0 = 4 ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/math/angular.py
articulate/math/angular.py
r""" Angular math utils that contain calculations of angles. """ __all__ = ['RotationRepresentation', 'to_rotation_matrix', 'radian_to_degree', 'degree_to_radian', 'normalize_angle', 'angle_difference', 'angle_between', 'svd_rotate', 'generate_random_rotation_matrix', 'axis_angle_to_rotation...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/math/spatial.py
articulate/math/spatial.py
r""" Spatial math utils that combine linear and angular calculations for rigid bodies. Also contains utils for articulated body kinematics. """ __all__ = ['transformation_matrix_np', 'adjoint_transformation_matrix_np', 'transformation_matrix', 'decode_transformation_matrix', 'inverse_transformation...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/math/general.py
articulate/math/general.py
r""" General math utils. """ __all__ = ['lerp', 'normalize_tensor', 'append_value', 'append_zero', 'append_one', 'vector_cross_matrix', 'vector_cross_matrix_np', 'block_diagonal_matrix_np'] import numpy as np import torch from functools import partial def lerp(a, b, t): r""" Linear interpol...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/math/__init__.py
articulate/math/__init__.py
r""" This package contains math utils for articulated body system including 3D rotation representation conversion, spatial math, etc. """ from .general import * from .angular import * from .spatial import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/print.py
articulate/utils/print.py
r""" Print with color. Colored text and background from https://www.geeksforgeeks.org/print-colors-python-terminal/. Modified from https://github.com/luigifreda/pyslam/blob/master/utils_sys.py. """ __all__ = ['Color', 'print_red', 'print_error', 'print_green', 'print_orange', 'print_purple', 'p...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/__init__.py
articulate/utils/__init__.py
r""" This package contains independent utils for some relative libraries. """
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/opencv/__init__.py
articulate/utils/opencv/__init__.py
r""" This package contains utils for opencv. """ from .visualization import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/opencv/visualization.py
articulate/utils/opencv/visualization.py
r""" View 2D keypoints in real-time using opencv. """ __all__ = ['view_2d_keypoint', 'view_2d_keypoint_on_z_1'] import cv2 import numpy as np import tqdm def view_2d_keypoint(keypoints, parent=None, images=None, thickness=None, fps=60): r""" View 2d keypoint sequence in image coordinate frame. Modifie...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/noitom/mocap_api.py
articulate/utils/noitom/mocap_api.py
r""" Python API for Noitom IMUs. Modified from https://github.com/pnmocap/neuron_mocap_live-blender/. """ __all__ = ['MCPError', 'MCPJointTag', 'MCPRigidBody', 'MCPSensorModule', 'MCPBodyPart', 'MCPJoint', 'MCPAvatar', 'MCPCommand', 'MCPCommandStopCatpureExtraFlag', 'MCPCommandExtraLong', 'MCPCommandPr...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
true
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/noitom/__init__.py
articulate/utils/noitom/__init__.py
r""" This package contains utils for Noitom sensors. """ from .mocap_api import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/unity/view_motion.py
articulate/utils/unity/view_motion.py
r""" View human motions in real-time using Unity3D. This is the server script. """ __all__ = ['MotionViewer'] import time import numpy as np import matplotlib import socket import cv2 class MotionViewer: r""" View human motions in real-time / offline using Unity3D. """ colors = matplotlib.color...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/unity/__init__.py
articulate/utils/unity/__init__.py
r""" This package contains utils for Unity3D. """ from .view_motion import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/rbdl/model.py
articulate/utils/rbdl/model.py
r""" Wrapper for RBDL model. """ __all__ = ['RBDLModel'] import rbdl import numpy as np from ...math import adjoint_transformation_matrix_np class RBDLModel: def __init__(self, model_file: str, gravity=np.array((0, -9.81, 0)), update_kinematics_by_hand=False): r""" Init an RBDL model. (num...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/rbdl/__init__.py
articulate/utils/rbdl/__init__.py
r""" This package contains utils for RBDL. """ from .model import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/xsens/xdc.py
articulate/utils/xsens/xdc.py
r""" Connect Xsens dot sensors. Modified from https://github.com/adamkewley/xdc """ __all__ = ['Acceleration', 'AngularVelocity', 'BatteryCharacteristic', 'ClipCountAcc', 'ClipCountGyr', 'ControlCharacteristic', 'DeviceControlCharacteristic', 'DeviceInfoCharacteristic', 'DeviceReportCharacte...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
true
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/xsens/xsens_dot_set.py
articulate/utils/xsens/xsens_dot_set.py
r""" Wrapper for an Xsens dot set. """ __all__ = ['XsensDotSet'] import asyncio import time from .xdc import * from queue import Queue import torch _N = 10 # max 10 IMUs class XsensDotSet: # _lock = [threading.Lock() for _ in range(_N)] # lists are thread-safe _SZ = 180 # max queue size _l...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/xsens/mvnx_reader.py
articulate/utils/xsens/mvnx_reader.py
r""" Reader for Xsens .mvnx file. """ __all__ = ['read_mvnx'] import xml.etree.ElementTree as ET import torch def quaternion_product(q1, q2): r""" Quaternion in w, x, y, z. :param q1: Tensor [N, 4]. :param q2: Tensor [N, 4]. :return: Tensor [N, 4]. """ w1, xyz1 = q1.view(-1, 4)[:,...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/xsens/__init__.py
articulate/utils/xsens/__init__.py
r""" This package contains utils for Xsens sensors. """ from .mvnx_reader import * from .xdc import * from .xsens_dot_set import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/torch/train.py
articulate/utils/torch/train.py
r""" Function to train a network. """ __all__ = ['train'] import os import torch from torch.utils.tensorboard import SummaryWriter from thop import clever_format import wandb def train(net, train_dataloader, vald_dataloader=None, save_dir='weights', loss_fn=torch.nn.MSELoss(), eval_fn=None, optimizer...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/torch/rnn.py
articulate/utils/torch/rnn.py
r""" Utils for RNN including networks, datasets, and loss wrappers. """ __all__ = ['RNNLossWrapper', 'RNNDataset', 'RNNWithInitDataset', 'RNN', 'RNNWithInit'] import os import torch.utils.data from torch.nn.functional import relu from torch.nn.utils.rnn import * class RNNLossWrapper: r""" Loss wrapper...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/torch/__init__.py
articulate/utils/torch/__init__.py
r""" This package contains utils for pytorch. """ from .rnn import * from .io import * from .train import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/torch/test.py
articulate/utils/torch/test.py
r""" Function to test a network. """ __all__ = ['test', 'test_next_batch'] import torch import os @torch.no_grad() def test(net, test_dataloader, load_dir=None): r""" Test a net on the full dataset. Return input, output, label. Assuming input, output, label are tensors. :param net: Network to test....
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/torch/io.py
articulate/utils/torch/io.py
r""" Utils for txt save/load. """ __all__ = ['load_txt_mat', 'save_txt_mat'] import torch def load_txt_mat(file, sep=','): r""" Load a matrix in txt where each line is the row and each entry is separated by `sep`. :param file: txt file name. :param sep: Sep char for each entry in a row. :...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/executables/xsens_dot_server.py
articulate/utils/executables/xsens_dot_server.py
r""" Xsens Dot GUI server process. Run this server separately with your client to reduce sensor crashes. """ import torch from queue import Empty from articulate.utils.xsens import XsensDotSet from articulate.utils.bullet.bullet import Button, Slider from articulate.utils.bullet.view_rotation_np import RotationVi...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/executables/xsens_offline_data_reader.py
articulate/utils/executables/xsens_offline_data_reader.py
import torch import os import glob input_dir = r'D:\yxy\Xsens_DOT_Data_Exporter-2021.0.0-win\data\20230124_021319' data = {} for file in glob.glob(os.path.join(input_dir, '*.csv')): with open(file, 'r') as f: sep = f.readline()[-2] print('sep:', sep) header = f.readline().split(sep) ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/executables/record_video.py
articulate/utils/executables/record_video.py
r""" Record video from camera. Press Q to save and quit. """ import cv2 cap = cv2.VideoCapture(2) wh = (1280, 720) fps = 10.0 is_color = True r""" This time we create a VideoWriter object. We should specify the output file name (eg: output.avi). Then we should specify the FourCC code (details in next parag...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/executables/xsens_dot_server_no_gui.py
articulate/utils/executables/xsens_dot_server_no_gui.py
r""" Xsens Dot cmd server process. Run this server separately with your client to reduce sensor crashes. """ import time import torch from queue import Empty from articulate.utils.xsens import XsensDotSet from pygame.time import Clock import socket import numpy as np import keyboard import articulate as art from a...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/executables/xsens_dot_client_example.py
articulate/utils/executables/xsens_dot_client_example.py
r""" An example of Xsens Dot client. """ import time import socket import numpy as np from pygame.time import Clock n_imus = 6 # must be the same as the server cs = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) cs.bind(('127.0.0.1', 8777)) cs.settimeout(5) clock = Clock() # clear the udp buffer while True: ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/executables/RGB_camera_calibration.py
articulate/utils/executables/RGB_camera_calibration.py
r""" Calibration of RGB cameras. Press C to capture enough (>= max_frames) chessboard pictures. """ import os import cv2 import numpy as np max_frames = 30 wh = (1280, 720) pattern_size = (9, 6) save_dir = 'captured_pics/' cv2.namedWindow('Camera View', 0) cv2.namedWindow('Captured Image', 0) cv2.imshow('Ca...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/pygame/view_streaming_data.py
articulate/utils/pygame/view_streaming_data.py
r""" View streaming 1D data in real-time using pygame. """ __all__ = ['StreamingDataViewer'] import pygame import numpy as np from collections import deque import matplotlib class StreamingDataViewer: r""" View 1D streaming data in real-time. """ W = 800 H = 600 colors = (np.array(matp...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/pygame/__init__.py
articulate/utils/pygame/__init__.py
r""" This package contains utils for pygame. """ from .view_streaming_data import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/bullet/view_rotation_np.py
articulate/utils/bullet/view_rotation_np.py
r""" View 3D rotations in real-time using pybullet (numpy quaternion xyzw). """ __all__ = ['RotationViewer'] import time import pybullet as p import pybullet_data import numpy as np from typing import List, Tuple, Union class RotationViewer: r""" View 3D rotations in real-time / offline. """ ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/bullet/bullet.py
articulate/utils/bullet/bullet.py
r""" Utils for pybullet. """ __all__ = ['remove_collision', 'change_color', 'load_debug_params_into_bullet_from_json', 'read_debug_param_values_from_bullet', 'read_debug_param_values_from_json', 'save_debug_params_to_json', 'Button', 'Slider'] import pybullet as p import json _param_attr...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/bullet/view_motion.py
articulate/utils/bullet/view_motion.py
r""" View human motions in real-time using pybullet. """ __all__ = ['MotionViewer'] import time import pybullet as p import numpy as np import os from .bullet import change_color import matplotlib from scipy.spatial.transform import Rotation _smpl_to_bullet = [0, 1, 2, 9, 10, 11, 18, 19, 20, 27, 28, 29, 3, 4,...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/bullet/__init__.py
articulate/utils/bullet/__init__.py
r""" This package contains utils for pybullet. """ from .bullet import * from .view_rotation import * from .view_motion import *
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
shaohua-pan/RobustCap
https://github.com/shaohua-pan/RobustCap/blob/d1ac718f7282898b4381b8097640eab6a06b5b3b/articulate/utils/bullet/view_rotation.py
articulate/utils/bullet/view_rotation.py
r""" View 3D rotations in real-time using pybullet. """ __all__ = ['RotationViewer'] import time import pybullet as p import pybullet_data import torch import numpy as np import cv2 from typing import List, Tuple, Union class RotationViewer: r""" View 3D rotations in real-time / offline. """ ...
python
MIT
d1ac718f7282898b4381b8097640eab6a06b5b3b
2026-01-05T07:10:07.080856Z
false
fcakyon/video-transformers
https://github.com/fcakyon/video-transformers/blob/8ada60b5a01964d813f11cd491d1bc22653e7303/setup.py
setup.py
import io import os import re import setuptools def get_long_description(): base_dir = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(base_dir, "README.md"), encoding="utf-8") as f: return f.read() def get_requirements(): with open("requirements.txt") as f: return ...
python
MIT
8ada60b5a01964d813f11cd491d1bc22653e7303
2026-01-05T07:10:31.263453Z
false
fcakyon/video-transformers
https://github.com/fcakyon/video-transformers/blob/8ada60b5a01964d813f11cd491d1bc22653e7303/tests/test_auto_head.py
tests/test_auto_head.py
import unittest class TestAutoHead(unittest.TestCase): def test_linear_head(self): import torch from video_transformers import AutoHead config = { "name": "LinearHead", "hidden_size": 256, "num_classes": 10, "dropout_p": 0.1, } ...
python
MIT
8ada60b5a01964d813f11cd491d1bc22653e7303
2026-01-05T07:10:31.263453Z
false
fcakyon/video-transformers
https://github.com/fcakyon/video-transformers/blob/8ada60b5a01964d813f11cd491d1bc22653e7303/tests/utils.py
tests/utils.py
import os import shutil import sys def shell(command, exit_status=0): """ Run command through shell and return exit status if exit status of command run match with given exit status. Args: command: (str) Command string which runs through system shell. exit_status: (int) Expected exit stat...
python
MIT
8ada60b5a01964d813f11cd491d1bc22653e7303
2026-01-05T07:10:31.263453Z
false
fcakyon/video-transformers
https://github.com/fcakyon/video-transformers/blob/8ada60b5a01964d813f11cd491d1bc22653e7303/tests/test_onnx.py
tests/test_onnx.py
import unittest class TestOnnx(unittest.TestCase): def test_onnx_export(self): from video_transformers import VideoModel config = { "backbone": { "name": "TransformersBackbone", "framework": {"name": "transformers", "version": "4.21.1"}, ...
python
MIT
8ada60b5a01964d813f11cd491d1bc22653e7303
2026-01-05T07:10:31.263453Z
false
fcakyon/video-transformers
https://github.com/fcakyon/video-transformers/blob/8ada60b5a01964d813f11cd491d1bc22653e7303/tests/test_auto_neck.py
tests/test_auto_neck.py
import unittest class TestAutoNeck(unittest.TestCase): def test_transformers_neck(self): import torch from video_transformers import AutoNeck config = { "name": "TransformerNeck", "num_features": 256, "num_timesteps": 8, "transformer_enc_nu...
python
MIT
8ada60b5a01964d813f11cd491d1bc22653e7303
2026-01-05T07:10:31.263453Z
false