This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pulp import * | |
def get_solver(pulp_cbc_path=pulp_cbc_path) -> PULP_CBC_CMD: | |
"""Get the solver with the correct path to the cbc executable. | |
https://github.com/coin-or/pulp/issues/62#issuecomment-2712486686 | |
Args: | |
pulp_cbc_path (str): The (incorrect) path to the cbc executable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Cross-view tracking Algorithm 1: Tracking procedure for each iteration. | |
@misc{chen2021crossviewtrackingmultihuman3d, | |
title={Cross-View Tracking for Multi-Human 3D Pose Estimation at over 100 FPS}, | |
author={Long Chen and Haizhou Ai and Rui Chen and Zijie Zhuang and Shuang Liu}, | |
year={2021}, | |
eprint={2003.03972}, | |
archivePrefix={arXiv}, | |
primaryClass={cs.CV}, | |
url={https://arxiv.org/abs/2003.03972}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Module to shift all labels in a given file by a given amount.""" | |
from __future__ import annotations | |
from pathlib import Path | |
import sleap | |
from sleap import Labels, LabeledFrame, Video |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sleap | |
from tqdm import tqdm | |
def main(ds: str, ds_out: str = None): | |
"""Removes all InstanceGroups and creates new ones based on track names. | |
Args: | |
ds: Path to the project file. | |
ds_out: Path to the output project file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
import time | |
from collections.abc import Callable | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from tqdm import tqdm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
extrinsics = np.array( | |
[ | |
[ | |
[-3.11213376e-01, -6.97047702e-01, 6.45964965e-01, -5.55457784e02], | |
[9.26706235e-01, -7.19443053e-02, 3.68835426e-01, -2.94434950e02], | |
[-2.10622385e-01, 7.13406278e-01, 6.68348481e-01, -1.90821965e02], | |
[0.00000000e00, 0.00000000e00, 0.00000000e00, 1.00000000e00], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
n_cameras = 6 | |
n_coords = 3 | |
# Fill our points and projection matrices with strings so we can verify reshaping | |
points = np.zeros((n_cameras, n_coords, 2), dtype="U3") | |
for cam_idx in range(n_cameras): | |
for coord_idx in range(n_coords): | |
for point_idx in range(2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Call triangulate function and analyze the traceback of certain functions. | |
The class containing the methods of interest should be wrapped with the | |
`trace_method_calls` decorator defined below. | |
This file serves as an example (excluding the modifications made to the | |
aniposelib/cameras.py file), follow the TODO instructions below to modify to your needs. | |
""" | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
import os | |
import random | |
from pathlib import Path | |
import sleap | |
from sleap import Labels | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This module implements cycle consistent matching using pairs of views.""" | |
from __future__ import annotations | |
from typing import Generator | |
import cv2 | |
import matplotlib.patches as patches | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import seaborn as sns |
NewerOlder