Simple REST wrapper for using Azure's Computer vision
If available in Hex, the package can be installed
by adding ex_azure_vision
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_azure_vision, "~> 0.1.2"}
]
end
# config/runtime.exs
config :ex_azure_vision,
header_name: System.get_env("AZURE_OCP_APIM_HEADER_NAME"),
subscription_key: System.get_env("AZURE_OCP_APIM_SUBSCRIPTION_KEY"),
base_url: System.get_env("AZURE_COGNITIVE_VISION_BASE_URI"),
scheme: "https"
iex> image_url = "https://images.unsplash.com/photo-1672676831425-207e5d4a0c41?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80"
iex> query_params = %{
visualfeatures: "Categories,Adult,Tags,Description,Faces,Objects",
details: "Landmarks"
}
iex> ExAzureVision.analyze(image_url, query_params)
{:ok, ...}
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_azure_vision.