Metadata-Version: 2.4
Name: trism-cv
Version: 0.0.2
Summary: A lightweight and modular Python package for handling computer vision inference (image/video) with Triton Inference Server.
Home-page: https://github.com/tien-ngnvan/trism-cv
Author: Tien Nguyen Van
Author-email: tien.ngnvan@gmail.com
Maintainer: Thanh Nguyen Nhut, Minh Nguyen Ngoc, Tan Mai Nhat
License: GNU AGPL v3.0
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: tqdm
Requires-Dist: tritonclient[all]
Requires-Dist: attrdict
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: maintainer
Dynamic: requires-dist
Dynamic: summary

# TRISM Inference Script
This script performs batch inference on a folder of images using a Triton Inference Server model.

## 📂 Input
- **image_folder**: Path to the folder containing images (jpg, png, etc.).
- Images are loaded using OpenCV (`cv2.imread`) into a list of `np.ndarray` objects.

## ⚙️ Configuration

```python
image_folder = "path/to/image_folder"   
model_name = "yolov_deyo_ensemble"
batch_size = 1 # You can pass a custom batch size or use default (e.g., 1)
```

## 🚀 Inference
```python
model = TritonModel(
    model=model_name, 
    version=1,                    # Model version on Triton server
    url="localhost:8001",         # Triton server address
    grpc=True                     # Use gRPC protocol for communication
)

outputs = model.run(
    data_list=images,              # list of images 
    auto_config=True,
    batch_size=batch_size
)
```

## 📤 Output
- A list of numpy arrays, one for each input image.
- Each output has shape `(n_detections, 6)` where `6 = [x1, y1, x2, y2, confidence, class_id]`

### 🧪 Debug Output
```python
for i, out in enumerate(outputs):
    print(f"Image {i}: shape = {out.shape}, dtype = {out.dtype}")
```

## License
[GNU AGPL v3.0](LICENSE).<br>
Copyright &copy; 2025 [Tien Nguyen Van](https://github.com/tien-ngnvan). All rights reserved.
