Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openvisionapi/ova-client
OpenVisionAPI Python Client
https://github.com/openvisionapi/ova-client
computer-vision machine-learning object-detection python
Last synced: 6 days ago
JSON representation
OpenVisionAPI Python Client
- Host: GitHub
- URL: https://github.com/openvisionapi/ova-client
- Owner: openvisionapi
- Created: 2021-05-06T20:58:02.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-22T17:36:58.000Z (12 months ago)
- Last Synced: 2024-08-01T22:48:48.668Z (4 months ago)
- Topics: computer-vision, machine-learning, object-detection, python
- Language: Python
- Homepage: https://openvisionapi.com
- Size: 1.24 MB
- Stars: 47
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
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] IMAGEOptions:
-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