semvec/pypi-packages huggingface dataset:
pytorch-gaussian-mixture 0.1.4
A Gaussian Mixture Model (GMM) based on Expectation-Maximisation (EM) implemented in PyTorch
Requires Python: >=3.6

# TorchGMM: A Gaussian Mixture Model Implementation with PyTorch

![TorchGMM logo](docs/_static/logo-no-background.png)

**TorchGMM** is a flexible implementation of Gaussian Mixture Models in PyTorch, supporting:

- EM Algorithm
- MAP Estimation with Priors
- Multiple Covariance Types
- Various Initialization Methods
- Comprehensive Clustering & Evaluation Metrics

## Features

1. **GaussianMixture**  
   - Full, diag, spherical, tied covariances  
   - MLE or MAP estimation with weight, mean, or covariance priors  

2. **GMMInitializer**  
   - `kmeans`, `kpp` (k-means++), `random`, `points`, `maxdist`  

3. **ClusteringMetrics**  
   - Unsupervised metrics (Silhouette, Davies-Bouldin, etc.)  
   - Supervised metrics (ARI, NMI, Purity, Confusion Matrix, etc.)  

## Installation

```bash
git clone https://github.com/YourUser/TorchGMM.git
cd TorchGMM
pip install -r requirements.txt
```

Make sure you have PyTorch installed. For GPU usage, install the CUDA-enabled version of PyTorch as per the official instructions.

## Documentation
We use Sphinx to build documentation. The generated HTML pages live under docs/_build/html/. You can also read them online if you host them (e.g., on GitHub Pages).

```bash
cd docs
make clean
make html
# Open _build/html/index.html in a browser
# Linux
xdg-open _build/html/index.html 
```

The docs include:

API Reference for all modules (see GaussianMixture, GMMInitializer, and ClusteringMetrics).
Tutorials that walk through different usage scenarios (basic GMM, metrics, using priors).
Tutorials
We provide three Jupyter notebooks in the tutorials/ folder:

GMM Tutorial: Basic usage of the GaussianMixture class.
Metrics Tutorial: Demonstrates ClusteringMetrics and how to compare models.
Priors Tutorial: Shows how to use weight/mean/covariance priors (MAP).
To view or run them locally, just open them in Jupyter or VS Code.

## Basic Usage Example
Here’s a short snippet:

```python
import torch
from utils.gmm import GaussianMixture

# Generate random 2D data
X = torch.randn(500, 2)

# Create and fit the GMM
gmm = GaussianMixture(
    n_features=2,
    n_components=3,
    covariance_type='full',
    max_iter=200
)
gmm.fit(X)

print("Converged?:", gmm.converged_)
print("Cluster Weights:", gmm.weights_)
print("Cluster Means:", gmm.means_)
```

You can also run on GPU by specifying device='cuda' in the GaussianMixture constructor (assuming a CUDA-capable device).

## Contributing
Fork the repository and create your feature branch.
Make changes and add tests or notebooks as appropriate.
Submit a pull request (PR) for review.
We welcome improvements to both the code and the documentation.

## License
Released under the MIT License.
© 2025, Adrián A. Sousa-Poza
clicktrack 0.1.0
Create click tracks in MIDI format.
Requires Python: >=3.10
Keywords: audio, cli, click track, command line, count-in, midi, midi-generator, music

# clicktrack: Create Click Tracks in MIDI Format

[![PyPI - Version](https://img.shields.io/pypi/v/clicktrack.svg)](https://pypi.org/project/clicktrack)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/clicktrack.svg)](https://pypi.org/project/clicktrack)

The `clicktrack` package can be used as a command-line tool or as a library to create click tracks for different time signatures, tempos, and numbers of beats. My personal use case is to create count-in tracks for [ukulele play-along videos](https://www.youtube.com/playlist?list=PLULqxG8JQOdu4oNWuiT_FIaCfsK1OcF05) for my project [UkeAlong](https://ukealong.com/).

This project is in its early stages, and the API may change. To view the command-line options after installing `clicktrack`, run:

    clicktrack -h
aim-guardrails 0.1.2
Aim Security Guardrails for OpenAI Agents
Requires Python: >=3.10

## Aim Security Guardrails for OpenAI Agents
This package provides guardrails for OpenAI agents that integrate with the Aim Security API to detect and prevent harmful content, sensitive data leakage, prompt injections, and other security threats.

## Installation

```bash
# install with pip
pip install aim-guardrails

# or install with poetry
poetry add aim-guardrails
```

## Configuration
Set your Aim Security API key as an environment variable:

```bash
export AIM_API_KEY=<your-api-key>
```

## Usage

You can use the helper functions to create guardrails with specific configurations:

```python
from pydantic import BaseModel
from agents import Agent, Runner
from aim_guardrails import get_aim_input_guardrail, get_aim_output_guardrail

class MessageOutput(BaseModel):
    response: str

# Create guardrails with custom configuration
input_guardrail = get_aim_input_guardrail(
    api_key="your-custom-api-key",  # Optional: defaults to AIM_API_KEY env var
    api_base="https://your-custom-api-base.example.com",  # Optional
    user_email="user@example.com"  # Optional: for tracking
)

output_guardrail = get_aim_output_guardrail(
    api_key="your-custom-api-key",  # Optional: defaults to AIM_API_KEY env var
    api_base="https://your-custom-api-base.example.com",  # Optional
    user_email="user@example.com"  # Optional: for tracking
)

# Create an agent with the configured guardrails
agent = Agent(
    name="Customer support agent",
    instructions="You are a customer support agent. You help customers with their questions.",
    input_guardrails=[input_guardrail],
    output_guardrails=[output_guardrail],
    output_type=MessageOutput,
)

async def main():
    try:
        # This will be checked by the input guardrail
        result = await Runner.run(agent, "Hello, can you help me with my question?")
        print(f"Response: {result.final_output.response}")
    except InputGuardrailTripwireTriggered as e:
        print(f"Input guardrail triggered: {e}")
    except OutputGuardrailTripwireTriggered as e:
        print(f"Output guardrail triggered: {e}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())
```

## How It Works

1. The input guardrail checks user messages before they're processed by the agent
2. The output guardrail checks agent responses before they're returned to the user
3. If restricted content is detected, a tripwire is triggered, raising an exception

## Creating an Aim Security Guard

1. Go to the [Aim Application](https://app.aim.security) and create a new guard
2. Configure your guard's policies in the prompt policy center
3. Get your API key from the guard's page
KLCserial 0.23
Functions and examples to control Thorlabs KLC controllers (KLC101) through serial commands with Python
Requires Python: >=3.10

# KLCserial
Functions and examples to control Thorlabs KLC controllers (KLC101) through serial commands with Python.

The official software can be found on the [Supplier Download Site](https://www.thorlabs.de/software_pages/ViewSoftwarePage.cfm?Code=KLC101). 
Documentation is also available through the same website. The serial commands have been partially assembled from the [Thorlabs Motion Controllers Host-Controller Communications Protocol](https://www.thorlabs.com/Software/Motion%20Control/APT_Communications_Protocol.pdf).

There is no specific documentation for the KLC101 so I assembled commands from other stages.

## Requirements
Needs `serial` and `pyserial` (both of them are needed for this to work somehow), best installed through:
```
pip install serial pyserial
```


## Usage

Simply run
```
pip install KLCserial
```
Then in your Python script invoke the functions by
```
from KLCserial import KLC
klc = KLC()
```
With `klc` you can then call all functions and methods of the controllers.

Look at [example.py](example.py). There are a few more commands implemented than shown in the example but they appear not to be too helpful for most applications.


## Serial ports
By default the `openKLC()`-function will use all the ports found under `/dev/serial/by-id/*Kinesis_LC_Controller*` (Windows: COM[0-255], *not tested*) and try to connect through serial.

You need write-access to the tty-port. Either run as the admin or change the permissions or the ownership on the serial port, preferably with a udev rule, e.g. something like
`/etc/udev/rules.d/80-usb-serial.rules`
```
SUBSYSTEM=="tty", MODE="0666"
```
(After changing run as root: `udevadm control --reload-rules && udevadm trigger`)

## License
This project is licensed under the MIT license.

## Acknowledgement
You're welcome!

Comments and suggestions highly welcome.
ventral 0.1.4
A client for Ventral Vision AI's API
Requires Python: >=3.7

# **Ventral Vision API Client** ðŸš€
A **lightweight, no-code-friendly vision API** for **object detection and segmentation**. Easily integrate it into your projects with just a few lines of code!  


![vision-api-banner](https://ventral.ai/wp-content/uploads/2024/08/Ventral_Vision_AI_1_-removebg-preview-e1724758129283.png) 

## **âœ¨ Features**  
âœ… **Plug & Play** â€“ Simple API integration with Python & JavaScript clients  
âœ… **Ultra Low-Cost** â€“ Affordable pricing with **Jetson-based cloud inference**  
âœ… **Customizable** â€“ Train & label your own models easily  
âœ… **On-Site Ready** â€“ Deploy locally if needed  

## **ðŸ“¦ Installation**  
### **Python Client**  
```bash
pip install ventral
```

### **JavaScript Client**
```bash
npm install ventral
```

## **ðŸš€ Quickstart**
### **Python Example**
```python
from ventral import VisionAPI

client = VisionAPIClient(api_key="your_api_key")

# Upload an image for object detection
print(client.detect_objects("test_image.jpg", class_name="car"))
```

### **JavaScript Example**
```javascript
import VisionAPI from "ventral";

const api = new VisionAPI("your_api_key");

// Upload an image for object detection
api.detectObjects("image.jpg").then(console.log);
```

## **ðŸ“¡ API Endpoints**
| Method | Endpoint  | Description                     |
|--------|-----------|---------------------------------|
| POST   | /detect   | Detect objects in an image      |
| POST   | /segment  | Perform image segmentation      |
| POST   | /classify  | Classify image     |
| POST   | /sam2-segment  | Perform image segmentation with SAM2 |
| POST   | /ocr  | Extract text from image |
| POST   | /image-caption  | Describe image |
ðŸ“– View full API documentation â†’ TBD

## **ðŸ’° Pricing**
| Plan     | Price   | Usage Limit                          |
|----------|---------|--------------------------------------|
| Free     | $0      | Limited calls per month              |
| Standard | $20/mo  | More API calls & priority support    |
| Pro      | $99/mo  | High usage & premium support         |
ðŸ”— Subscribe here

## **ðŸ“¢ Get Started Today!**
Sign up at ventral.ai and get your FREE API key today! ðŸš€