This file contains 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 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 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 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 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 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 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 |
This file contains 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
"""Outline number of labeled frames, recording sessions, and video paths for all SLPs in directory. | |
This script recursively finds SLP files in a directory and outputs a CSV outlining how many labeled frames, recording | |
sessions, and videos there are in each slp project within a directory. | |
""" | |
import pathlib | |
import pandas as pd |
This file contains 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
"""Script to find when an annotation is in a ROI of a given image. | |
# Installation | |
```bash | |
conda create -c conda-forge sleap-io shapely -n sio | |
``` | |
# Usage | |
Make changes to the __main__ block at the bottom of the file. Then activate the | |
environment and run the script. |
This file contains 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 | |
import pandas as pd | |
import shapely | |
import sleap_io as sio | |
from shapely import Polygon | |
from sleap_io import Instance, Labels, LabeledFrame, PredictedInstance, Track | |
def load_rfid_rois(ds_rfid: str): | |
"""Load a dictionary of RFID ROI `Polygons`. |
NewerOlder