Metadata-Version: 2.4
Name: jaimead7-vimi
Version: 0.0.1
Summary: Interface for AI vision models.
Author-email: Jaime Álvarez <alvarez.diaz.jaime1@gmail.com>
Maintainer-email: Jaime Álvarez <alvarez.diaz.jaime1@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Jaimead7/ViMI
Project-URL: Repository, https://github.com/Jaimead7/ViMI
Keywords: AI,Vision
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ncnn
Requires-Dist: pydantic
Requires-Dist: pyyaml
Requires-Dist: typing_extensions
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# ViMI - *Vision Models interface*
<center>

[![License](https://img.shields.io/static/v1.svg?label=LICENSE&message=MIT&color=2dba4e&colorA=2b3137)](https://github.com/Jaimead7/ViMI/blob/master/LICENSE)
[![PyPI Latest Release](https://img.shields.io/pypi/v/jaimead7-vimi.svg?color=2dba4e)](https://pypi.org/project/jaimead7-vimi/)  
</center>  

Interface for AI vision models.  

## Authors
> Jaime Alvarez Diaz  
> [![email](https://img.shields.io/static/v1.svg?label=Gmail&message=alvarez.diaz.jaime1@gmail.com&logo=gmail&color=2dba4e&logoColor=white&colorA=c71610)](mailto:alvarez.diaz.jaime1@gmail.com)  
[![GitHub Profile](https://img.shields.io/static/v1.svg?label=GitHub&message=Jaimead7&logo=github&color=2dba4e&colorA=2b3137)](https://github.com/Jaimead7)  

## Installation
Install as a package from source files
```powershell
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 models folder with a valid structure. You can find examples in [./test/models/](./test/models/).

```python
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 SystemError(f'Cant\'t open the model "{MODEL_PATH}".')

results: list[Results] = model(IMGS_PATHS)

if len(results) >= 0:
    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](https://docs.ultralytics.com/es/models/yolo11/) models:
| *type*       | **ncnn** | **pyTorch** |
| ------------ | :------: | :---------: |
| classify     | ✅ | ❌ |
| detect       | ✅ | ❌ |
| obb          | ❌ | ❌ |
| pose         | ❌ | ❌ |
| segmentation | ❌ | ❌ |

## License
This project is licensed under the [MIT](./LICENSE) 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.
