Skip to main content

A collection of small but useful tools for scientific publications and projects

Project description

vibing

A collection of small but useful tools for scientific publications and projects.

Installation

From PyPI (recommended)

# Using uv
uv pip install vibing

# Using pip
pip install vibing

# With optional dependencies
uv pip install "vibing[calibration]"  # Camera calibration tools (opencv)
uv pip install "vibing[sleap]"        # SLEAP conversion tools
uv pip install "vibing[all]"          # Everything

Run CLI without installing (uvx)

# Run distortion checker directly
uvx --from "vibing[calibration]" vibing-distortion-check video.mp4

# Or install as a tool
uv tool install "vibing[calibration]"
vibing-distortion-check video.mp4

From GitHub

# Install from git
uv pip install "git+https://github.com/LeoMeow123/vibes.git[calibration]"

# Run without installing
uv tool run --from "git+https://github.com/LeoMeow123/vibes.git[calibration]" vibing-distortion-check video.mp4

From source

git clone https://github.com/LeoMeow123/vibes.git
cd vibes
uv pip install -e ".[all]"

Tools

Calibration (vibing.calibration)

Camera calibration and distortion analysis tools.

  • check_video - Analyze video for lens distortion using charuco board
  • check_image - Analyze single image for distortion
  • check_batch - Batch process directory of videos
  • CharucoBoardConfig - Configure charuco board parameters
  • DistortionMetrics - Distortion analysis results

CLI: vibing-distortion-check

# Check single video
vibing-distortion-check video.mp4

# Batch process directory
vibing-distortion-check /path/to/videos --batch --output-csv results.csv

# Custom board configuration
vibing-distortion-check video.mp4 --squares-x 10 --squares-y 7

Optimization (vibing.optimization)

Gradient-based and gradient-free optimization wrappers.

  • minimize_lbfgsb - L-BFGS-B optimization
  • minimize_gradient_free - Gradient-free methods (Nelder-Mead, Powell, COBYLA)

Plotting (vibing.plotting)

Utilities for creating publication-quality figures.

  • setup_figure - Set up figures with consistent styling
  • save_figure - Save figures in multiple formats

Powerwell (vibing.powerwell)

Powerwell analysis tools.

  • Coming soon

Undistortion (vibing.undistortion)

Video undistortion and perspective correction pipelines using OpenCV.

  • spacecage-undistort - Fisheye lens distortion correction for NASA SpaceCage experiments with ROI-based calibration and SLEAP coordinate transformation
  • tmaze-undistort - T-maze video processing with lens distortion removal and perspective transformation to top-down views using labeled ROIs and known physical dimensions

SLEAP Convert (vibing.sleap_convert)

Convert SLEAP predictions to ROI polygon YAML format.

  • slp_to_roi_yaml - Convert single SLP file to ROI YAML
  • convert_batch - Batch convert directory of SLP files
  • extract_keypoints - Extract keypoints from SLP (low-level)
  • ROITemplate - Define custom polygon templates for any arena

CLI: vibing-slp-to-yaml

# Convert single file
vibing-slp-to-yaml predictions.slp -o output.yml

# Batch convert directory
vibing-slp-to-yaml /path/to/slps --batch -o /path/to/yamls

# List available templates
vibing-slp-to-yaml --list-templates

Built-in templates: tmaze_horizontal (7-region T-maze with corner sharing)

Quick Start

import numpy as np
from vibing.optimization import minimize_lbfgsb
from vibing.plotting import setup_figure, save_figure

# Optimization example
def objective(x):
    return (x[0] - 1) ** 2 + (x[1] - 2) ** 2

result = minimize_lbfgsb(objective, np.array([0.0, 0.0]))
print(f"Optimal x: {result['x']}")

# Plotting example
fig, ax = setup_figure(width=6, height=4)
ax.plot([1, 2, 3], [1, 4, 9])
save_figure(fig, "my_plot", formats=["png", "pdf"])

Development

# Clone and install in dev mode
git clone https://github.com/LeoMeow123/vibes.git
cd vibes
uv pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check src/

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibing-0.2.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibing-0.2.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file vibing-0.2.0.tar.gz.

File metadata

  • Download URL: vibing-0.2.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vibing-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6e4d76b98f570ca70e99f394957e1e9953e13125a8afde86c8689a7426689e81
MD5 a2e62913518f90fa9bb33435eff0701a
BLAKE2b-256 5978495df8f710c12ff2749389f6eabf01ceddac48f565084e4a388d0e6f1a5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibing-0.2.0.tar.gz:

Publisher: publish.yml on LeoMeow123/vibes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibing-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vibing-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vibing-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fffc8b492f59afdcdf4ebc01536ed06d89c6075b22148799545faa552361295
MD5 7d5e539aa0d82ada2bb73b036515a288
BLAKE2b-256 b970a6259b1576b5af4b5da214f32ce935345737aa02ded3b344fc6966d7c0b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibing-0.2.0-py3-none-any.whl:

Publisher: publish.yml on LeoMeow123/vibes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page