Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/openvisionapi/ova-client

OpenVisionAPI Python Client
https://github.com/openvisionapi/ova-client

computer-vision machine-learning object-detection python

Last synced: about 2 months ago
JSON representation

OpenVisionAPI Python Client

Awesome Lists containing this project

README

        


OpenVisionAPI Client

![Static Badge](https://img.shields.io/badge/AGPLV3-License?style=for-the-badge&label=LIcense)

## 🚀 Getting Started

### Prerequisites

You'll need to install:

- [just](https://github.com/casey/just)
- [poetry](https://python-poetry.org/)

### Setup

Install the dependencies

```bash
$ just setup
```

### Usage

```
$ poetry run ./ova.py detection /path/to/image
```

The available options for the cli:

```bashh
$ poetry run ./ova.py detection --help
Usage: ova_client.py detection [OPTIONS] IMAGE

Options:
-s, --save Save the output image.
-v, --visualize Draw bounding boxes on the detected objects.
--help Show this message and exit.
```

### Want to use httpie ?

```
$ pip install --user httpie
$ http -f POST https://api.openvisionapi.com/api/v1/detection model="yolov4" image@images/cat.jpeg

{
"description": "Detected objects",
"predictions": [
{
"bbox": {
"x1": 442,
"x2": 982,
"y1": 199,
"y2": 1270
},
"label": "cat",
"score": "0.93"
}
]
}
```

### Want to use curl ?

```
$ curl -X POST https://api.openvisionapi.com/api/v1/detection \
-F "model=yolov4" \
-F "image=@images/cat.jpeg"

{
"description": "Detected objects",
"predictions": [
{
"bbox": {
"x1": 442,
"x2": 982,
"y1": 199,
"y2": 1270
},
"label": "cat",
"score": "0.93"
}
]
}
```

### Configuration

The configuration can be set up using the following env variables:

**OVA_DETECTION_URL** : The URL to the OpenVisionAPI server. The default is `https://api.openvisionapi.com/api/v1/detection`

**OVA_OUTPUT_DIR** : The directory where to store the result. The default is `./output`


## ⛏️ Built Using

- [Pillow](https://github.com/python-pillow/Pillow)
- [click](https://github.com/pallets/click)
- [requests](https://github.com/psf/requests)
- [pygments](https://github.com/pygments/pygments)


## 🤝 Contributing

Your contributions are welcome !

### Setting up development environment

To setup the development environment, simply run this command

```bash
$ just dev
```

### Code-style checks

ruff and mypy are used to ensure that contributions are stylized in a uniform manner.

- [ruff](https://github.com/astral-sh/ruff) is used as a linter and a code formatter.
- [mypy](https://github.com/python/mypy) is used for static typing


## 🔧 Tests

To run the tests, simply run those commands

```bash
$ just dev
$ just test
```


## ⚖️ License

AGPLv3