Interface for AI vision models.
Project description
Interface for AI vision models.
Authors
Installation
Install as a package from source files
git clone https://github.com/Jaimead7/ViMI.git
cd ViMI
py -m pip install .
Install as a package from pypi
py -m pip install jaimead7-vimi
Usage
Create a model folder with a valid structure. You can find examples in ./test/models/.
from pathlib import Path
from typing import Optional
import cv2
import numpy as np
from vimi.engines import EnginesReg, ModelEngine
from vimi.results import Results
MODEL_PATH: Path = Path('./test/models/DetectModelNCNN')
IMGS_PATHS: list[Path] = [
Path(Path('./test/imgs/coco/bike.jpg')),
Path(Path('./test/imgs/coco/planes.jpg'))
]
model: Optional[ModelEngine] = EnginesReg.get_model(MODEL_PATH)
if model is None:
raise RuntimeError(f'Cant\'t open the model "{MODEL_PATH}".')
results: list[Results] = model(IMGS_PATHS)
if len(results) != len(IMGS_PATHS):
raise RuntimeError(f'Error processing images: Expected {len(IMGS_PATHS)} Results, got {len(results)}.')
for result, img in zip(results, IMGS_PATHS):
cv2.imshow(f'{img.name}', result.plot())
_: int = cv2.waitKey(0)
cv2.destroyAllWindows()
Available model interfaces
YOLO11 models:
| type | ncnn | pyTorch |
|---|---|---|
| classify | ✅ | ❌ |
| detect | ✅ | ❌ |
| obb | ✅ | ❌ |
| pose | ❌ | ❌ |
| segmentation | ❌ | ❌ |
License
This project is licensed under the MIT license.
Third-party models:
The ./test/ directory contains model files that are subject to their own respective licenses. Each model includes a metadata.yaml file specifying its applicable license terms. Please refer to these metadata files for details.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
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 Distributions
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 jaimead7_vimi-0.0.2-py3-none-any.whl.
File metadata
- Download URL: jaimead7_vimi-0.0.2-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6797be9427a2d27a5b8e9346b7b2bf424553804f2f962c52dd36428c48bf89b5
|
|
| MD5 |
be21104f6cdab01a2127ba36d1ab3a58
|
|
| BLAKE2b-256 |
b4323a491f22165cec041a431180438890deb4fc10a507f7a1de5ad37134efde
|