Git Product home page Git Product logo

ex_vision's Introduction

ExVision

Hex.pm API Docs

ExVision is the collection of AI models related to vision delivered with ready to use package and easy to understand API. ExVision will take care of all necessary input transformations internally and return the result in the sensible format.

ExVision models are powered by Ortex.

Usage

In order to use the model, you need to first load it

alias ExVision.Classification.MobileNetV3Small

model = MobileNetV3Small.load() #=> %MobileNetV3{}

After that, the model is available for inference. ExVision will take care of all necessary input transformations and covert output to a format that makes sense.

MobileNetV3Small.run(model, "example/files/cat.jpg") #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}

ExVision is also capable of accepting tensors and images on input:

cat = Image.open!("example/files/cat.jpg")
{:ok, cat_tensor} = Image.to_nx(cat)
MobileNetV3Small.run(model, cat) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
MobileNetV3Small.run(model, cat_tensor) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}

Usage in process workflow

All ExVision models are implemented using Nx.Serving. They are therefore compatible with process workflow.

You can start a model's process:

{:ok, pid} = MobileNetV3Small.start_link(name: MyModel)

or start it under the supervision tree

{:ok, _supervisor_pid} = Supervisor.start_link([
  {MobileNetV3Small, name: MyModel}
], strategy: :one_for_one)

After starting, it's immediatelly available for inference using batched_run/2 function.

MobileNetV3Small.batched_run(MyModel, cat) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}

Installation

The package can be installed by adding ex_vision to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_vision, "~> 0.3.1"}
  ]
end

In order to compile, ExVision requires Rust and Cargo to be installed on your system.

Current Timeline

We have identified a set of models that we would like to support. If the model that you would like to use is missing, feel free to open the issue, express interest in an existing one or contribute the model directly.

  • Classification
    • MobileNetV3 Small
    • EfficientNetV2
    • SqueezeNet
  • Object detection
    • SSDLite320 - MobileNetV3 Large backbone
    • FasterRCNN ResNet50 FPN
  • Semantic segmentation
    • DeepLabV3 - MobileNetV3
  • Instance segmentation
    • Mask R-CNN
  • Keypoint Detection
    • Keypoint R-CNN

Copyright and License

Copyright 2024, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0

ex_vision's People

Contributors

daniel-jodlos avatar jakmro avatar mkopcins avatar msluszniak avatar vinagrito avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.