https://github.com/joshniemela/vision.jl
A wrapper for Google's vision API to communicate with Julia
https://github.com/joshniemela/vision.jl
Last synced: 3 months ago
JSON representation
A wrapper for Google's vision API to communicate with Julia
- Host: GitHub
- URL: https://github.com/joshniemela/vision.jl
- Owner: joshniemela
- License: mit
- Created: 2022-11-15T15:17:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-01T21:33:56.000Z (over 2 years ago)
- Last Synced: 2025-03-02T16:08:59.282Z (4 months ago)
- Language: Julia
- Size: 123 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vision.jl
A Julia package for easily interacting with the [Google Vision API](https://cloud.google.com/vision/).The package currently implements the following features:
1. `makeRequestBody` - creates a request body for the Google Vision API from either a base 64 encoded image or a URI to an image containing one or more features.2. `visionFeature` - creates a `VisionFeature` object for use in the request body.
3. `getResponse` - sends a request to the Google Vision API and returns the response.
4. `parseFeatures` - parses the response from the Google Vision API, currently only supports `textAnnotations`
## How to use
Install "Vision" from the Julia package manager.
```julia
] add Vision
```
Export your google API key to `JULIA_VISION_API_KEY` or manually override the URL used by `getResponse`## Example code snippets
### Using base64 encoded images
```julia
using Vision
using Base64image = base64encode(open("example.jpg", "r"))
requestBody = makeRequestBody(image, visionFeature("DOCUMENT_TEXT_DETECTION"))
response = getResponse(requestBody)
println(parseFeatures(response))
```### Using URI's
```julia
using Vision
using URIsrequestBody = makeRequestBody(
URI("https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Julia_Programming_Language_Logo.svg/1920px-Julia_Programming_Language_Logo.svg.png"),
[
visionFeature("LABEL_DETECTION", 50),
visionFeature("TEXT_DETECTION", 50),
visionFeature("LOGO_DETECTION", 1),
]
)
response = getResponse(requestBody)println(parseFeatures(response))
```
See [Documentation](https://docs.juliahub.com/Vision) for more details.