A machine learning toolset for embedded / edge devices.
Project description
cl_ml_tools: Command-Line Machine Learning Toolkit
cl_ml_tools is a Python package designed to provide a collection of robust, reusable, and command-line friendly tools for common machine learning tasks. The goal is to offer modular components that can be easily integrated into larger applications or used as standalone utilities. These tools are specifically developed and tested for deployment on edge devices and low-resource systems, ensuring efficient performance where computational power is limited.
Features
- Modular Design: Each tool is self-contained and designed for a specific purpose.
- Extensible: Easily integrate your own components, such as custom inference engines or data stores.
- Command-Line Friendly: Built with CLI operations in mind for easy scripting and automation.
Available Tools
1. VectorCore
VectorCore is the first tool in this collection. It provides a generic and powerful framework for vector-based similarity search. It is designed to be backend-agnostic, allowing you to plug in different machine learning models for inference and various vector databases for storage.
Key Features of VectorCore:
- Pluggable Inference Engine: Bring your own model to generate embeddings or feature vectors.
- Pluggable Vector Store: Use different vector databases (like Qdrant, Milvus, etc.) for storing and searching vectors.
- Generic: Not limited to images. It can handle any data type as long as you provide the appropriate preprocessing and inference logic.
- Batch Processing: Efficiently process large amounts of data.
Installation
To install the package and its dependencies, clone the repository and run the following command from the root directory:
pip install .
Getting Started with VectorCore
Here is a high-level example of how to use VectorCore. For a detailed, runnable example, please see the example/ directory.
from cl_ml_tools import VectorCore
from your_project.inference import MyInferenceEngine
from your_project.store import MyVectorStore
# 1. Initialize your custom components
inference_engine = MyInferenceEngine(model_path="path/to/your/model.hef")
vector_store = MyVectorStore(collection_name="my_collection")
# 2. Initialize VectorCore with your components
vector_core = VectorCore(
inference_engine=inference_engine,
store_interface=vector_store,
)
# 3. Add items to the index
files_to_add = {
1: "/path/to/image1.jpg",
2: "/path/to/image2.png"
}
payloads = {
1: {"filename": "image1.jpg"},
2: {"filename": "image2.png"}
}
vector_core.add_all(files=files_to_add, payload=payloads)
# 4. Perform a similarity search
search_results = vector_core.search(data="/path/to/query_image.jpg", limit=5)
print(search_results)
Future Development
We plan to expand cl_ml_tools with more utilities to address other common machine learning tasks. Stay tuned for updates!
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cl_ml_tools-0.1.0.tar.gz.
File metadata
- Download URL: cl_ml_tools-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec8f45e1204c4d6a2e7c63b7f0b5b119525babf4cb6d09511a45516bc660354b
|
|
| MD5 |
a46ae8ce4fc8df822bd763259de1f929
|
|
| BLAKE2b-256 |
1ee126ccbe3f2170ff21cdf703c358868f202a132acc76c450c9c3a8a256d053
|
File details
Details for the file cl_ml_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cl_ml_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4ca22ffa388695b9e172173762321849215e8e4b1c60a7bc06dfa3004318aa7
|
|
| MD5 |
d8bb61f475588236aaf72c2c304397c7
|
|
| BLAKE2b-256 |
e3bf77a63932f6e75924c586be993078c3162c01ff9326d1feb5cb063d6d68eb
|